-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Unable to set target for Web Workers #17512
Comments
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I'm facing the same issue. Anyone else? Any workarounds? |
You can send a PR with fix, should not be hard |
Any workarounds or updates? I am using |
Also hitting this issue and have a repro case here: https://github.com/spmonahan/decode-named-character-reference-worker-webpack-bug |
Bug report
What is the current behavior?
Unable to set target for Web Workers
My worker uses the package named
decode-named-character-reference
, the package exports as bellow,When I compile my website with webpack, the target is to use Defaults to
browserslist
, and it compile my web worker use its exports"browser": "./index.dom.js"
, the error happensReferenceError: document is not defined
.If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
How can I set my web worker's target to
webworker
separately?I want to compile the package named
decode-named-character-reference
use its exports"worker": "./index.js"
, then it can work well.Other relevant information:
webpack version: 5.73.0
Node.js version: 14.20.0
Operating System: macOS Big Sur
Additional tools: VS code
The text was updated successfully, but these errors were encountered: