You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the library gets used on top of a SharedWorker implemented as a worker program, the wrapping init function fails because document does not exist in the context of the worker.
The failing line in my case is hmr.js#L174 but L170 is going to have the same problem.
Adding a simple guard if (typeof document !== 'undefined') seems to solve the problem at least for me.
The text was updated successfully, but these errors were encountered:
The expected behaviour is to see log output (current time every 3 seconds) from the shared worker.
I kicked it off from a starter repo and apart from adding a shared worker loader, I had to downgrade Webpack to version 3 to replicate the issue. V4 ended up with a different error which seems unrelated to this project (the injected HMR code references window directly).
When the library gets used on top of a SharedWorker implemented as a worker program, the wrapping init function fails because
document
does not exist in the context of the worker.The failing line in my case is hmr.js#L174 but L170 is going to have the same problem.
Adding a simple guard
if (typeof document !== 'undefined')
seems to solve the problem at least for me.The text was updated successfully, but these errors were encountered: