Skip to content

Fix SSR with Nuxt.js #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2017
Merged

Fix SSR with Nuxt.js #43

merged 1 commit into from
Sep 25, 2017

Conversation

atinux
Copy link
Contributor

@atinux atinux commented Sep 21, 2017

Hi,

To test if the component is run on client-side, we can test directly if typeof window !== 'undefined' :)

Thank you for this great component!

Hi,

To test if the component is run on client-side, we can test directly if typeof window !== 'undefined' :)

Thank you for this great component!
@staskjs
Copy link
Owner

staskjs commented Sep 24, 2017

I am not really into nuxt, but what is the problem with BROWSER_BUILD? It does not work any more?

@Ficik
Copy link

Ficik commented Sep 24, 2017

Problem with current code is that process.BROWSER_BUILD is undefined during server render and that process.BROWSER_BUILD == null is true.

Fix is either using === instead of == or check for actual dependecy of the library (window)

@staskjs staskjs merged commit 13151d6 into staskjs:master Sep 25, 2017
@atinux atinux deleted the patch-1 branch September 25, 2017 08:28
@xloading
Copy link

xloading commented Sep 4, 2018

Hi @atinux !
Was this PR supposed to fix this plugin's compatibility with Nuxt?
Asking because I'm trying to use it with Nuxt right now but get the same exception as in #38 :
Unexpected token <

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants