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

Potential crash during server-side rendering #44

Closed
feimosi opened this issue May 4, 2017 · 0 comments
Closed

Potential crash during server-side rendering #44

feimosi opened this issue May 4, 2017 · 0 comments

Comments

@feimosi
Copy link

feimosi commented May 4, 2017

If you're using SSR, the environment lacks DOM globals, but the dependencies are treated like in the browser environment. In your code, you're assigning an empty object to the document:

that.document = {};

which is a serious hazard and can simply crash any code depending on this. Here's an example of one of my dependencies (store.js):

image

Seems like React's SSR uses node-process which sets the browser property on process object:
https://github.com/defunctzombie/node-process/blob/master/browser.js#L156

Based on this fact I've prepared a quick & dirty fix:
feimosi@6a58481
Would be great if you could incorporate it into the next release or suggest a better solution.

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

1 participant