Skip to content
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

Server Side Rendering Skipped due to error: window is not defined #515

Open
EyalSi opened this issue Oct 5, 2018 · 4 comments
Open

Server Side Rendering Skipped due to error: window is not defined #515

EyalSi opened this issue Oct 5, 2018 · 4 comments

Comments

@EyalSi
Copy link

EyalSi commented Oct 5, 2018

I have a large app using choo.js and bankai.
I'm trying to move from choo 6.0.0 to 6.13.0 & bankai 8.1.1 to 9.15.0
I'm getting the following error when running bankai build:
node ./node_modules/bankai/bin.js build index.js

"Server Side Rendering Skipped due to error: window is not defined"

Does anyone have an idea why I'm getting this? everything is working, but wanted to know what is the problem...

@laduke
Copy link
Contributor

laduke commented Oct 15, 2018

for me, it was that I had a reference window in my choo entry point. (even trying to wrap it in like if (window) {...} )

@blahah
Copy link

blahah commented Jan 31, 2019

this is such persistent issue for me - and clearly for others. I think this should be possible for bankai to handle automatically. Specifically I think it should be possible to make a browserify transform that detects calls to the browser-exclusive API and wraps them automatically in the necessary protection to allow server-side rendering.

Is there any reason not to do this?

@blahah
Copy link

blahah commented Jan 31, 2019

Also - I really think this needs to be in the README. Bankai errors out with no obvious route to a solution on many of the standard browser libraries. @yoshuawuyts thoughts on documenting it until a better solution is in place?

edit - links to where others eloquently described the problem:

@yoshuawuyts
Copy link
Member

@blahah PRs to document this would be very welcome. Possibly its own section in the readme, or else as part of a FAQ.

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

No branches or pull requests

4 participants