-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Abnormal behaviors in building worker modules. #15310
Comments
Start a new pull request in StackBlitz Codeflow. |
It sounds similar to this closed issue and the corresponding PR:
It looks like that PR handled the exact expression |
Yeah, perhaps we need to do additional processing for |
may be inconsistency in variable names . give it a try though and even import.meta.url needs to be processed furthur |
Describe the bug
When handling
worker
modules,Vite
usesRollup
for building, and the default target output isiife
. However, an interesting issue #15305 was discovered when the target output isiife
and there is an exception in handling the statement byRollup
.There will definitely be an issue in
worker
modules because thedocument
instance cannot be accessed withinworker
. It behaves correctly when the target output ises
. This also creates a differentiation between the development stage and the build stage, so some additional handling may be required in this case.Reproduction
https://stackblitz.com/edit/vitejs-vite-bryjvn?file=index.html
Steps to reproduce
pnpm install && pnpm build && pnpm preview
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: