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

Self-reference dependency has unused export name when imported inside of a web worker #18315

Open
pgoldberg opened this issue Apr 11, 2024 · 0 comments
Labels

Comments

@pgoldberg
Copy link
Contributor

pgoldberg commented Apr 11, 2024

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 when usedExports: "global" is set.

If the current behavior is a bug, please provide the steps to reproduce.

Repro: https://github.com/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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Priority - High
Development

No branches or pull requests

2 participants