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

HMR Webworker: window isn't available #2908

Closed
mischnic opened this issue Apr 9, 2019 · 4 comments · Fixed by #3078
Closed

HMR Webworker: window isn't available #2908

mischnic opened this issue Apr 9, 2019 · 4 comments · Fixed by #3078
Labels
🐛 Bug HMR Hot Module Reloading

Comments

@mischnic
Copy link
Member

mischnic commented Apr 9, 2019

Hello, I'm currently getting an HMR error in my WebWorkers that seems to be related to a use of the window global in the hmr runtime here. It wasn't clear to me if the fix was as simple as changing window.location.reload() to location.reload() and if there had been an unintentional regression introduced by #2676 so for now I'm just leaving this note -- any comments welcome. thanks, nehal

Originally posted by @habemus-papadum in #528 (comment)

@mischnic mischnic added 🐛 Bug HMR Hot Module Reloading labels Apr 9, 2019
@mischnic
Copy link
Member Author

mischnic commented Apr 9, 2019

self.location.reload isn't actually defined for a worker.
The only solution I see is disabling (traditional) HMR for workers.

@habemus-papadum
Copy link

#529 seems to try to fix a similar problem (at a different location in the hmr runtime) by changing window.location.reload to location.reload. Also see the comments in #476 regarding self.location vs accessing location via implicit global. Was this fix incorrect or am I misunderstanding?

@mischnic
Copy link
Member Author

mischnic commented Apr 9, 2019

There are two issues here:

@mischnic
Copy link
Member Author

Closing for #3076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug HMR Hot Module Reloading
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants