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

window is not defined #35

Closed
hronro opened this issue Apr 23, 2018 · 7 comments
Closed

window is not defined #35

hronro opened this issue Apr 23, 2018 · 7 comments
Labels

Comments

@hronro
Copy link

hronro commented Apr 23, 2018

I got this error when I upgrade webpack to v4
image
image

@hronro
Copy link
Author

hronro commented Apr 23, 2018

It seems like this is caused by webpack hot reload: webpack/webpack#6642

@developit
Copy link
Owner

Should be fixed in Webpack soon.

@developit
Copy link
Owner

For now I've made workerize-loader detect when output.globalObject is set to window, and it will simply show a warning and recommend setting it to self or this.

@bidiu
Copy link

bidiu commented Oct 10, 2018

What should I do if I am using create-react-app without ejecting (I don't have access to the config file of Webpack)? Just upgraded to react-script 2.0+, it starts to break.

@developit
Copy link
Owner

@bidiu - can you file an issue with create-react-app? They should be using self as the default.

@bidiu
Copy link

bidiu commented Oct 10, 2018

@developit Thanks!

@bknill
Copy link

bknill commented Oct 19, 2018

You can use react-app-rewired with config.output.globalObject= self in the config-overrides in a CRA to change this

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

No branches or pull requests

4 participants