-
-
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 ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-reference dependency has unused export name when imported inside of a web worker #18315
Comments
Hello, I did so work on this issue, and find out the process of bug occurrence, but I got no clue how to solve it, could anyone please give me some suggestion Should I just ignore this error in CommonJsSelfReferenceDependency when config 'usedExports'? |
Hm, you can send a PR and we will look our tests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
What is the current behavior?
When a web worker imports a CommonJS module with a self reference dependency, webpack throws
Error: Self-reference dependency has unused export name: This should not happen
.This happens when
usedExports
is set to"global"
.I think this is related:
#12646/#12648
It seems like that fix works when
usedExports
is not set to"global"
,but it doesn't work whenusedExports: "global"
is set.If the current behavior is a bug, please provide the steps to reproduce.
Repro:https://github /pgoldberg/webpack-self-reference-dependency-worker-bug
What is the expected behavior?
Webpack should not throw an error
Other relevant information:
webpack version: 5.91.0
Node.js version: any
Operating System: any
Additional tools:
The text was updated successfully, but these errors were encountered: