-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
feat: web workersinconsistencyInconsistency between dev & buildInconsistency between dev & buildpending triage
Description
Describe the bug
When import
is used in classic worker, the following error happens during dev.
Uncaught SyntaxError: Cannot use import statement outside a module
But build works with it and the bundle seems to be correctly bundled.
According to the docs, import
can be used inside classic worker if worker is imported with query suffixes.
There is no mention about constructor type worker import. But if it is the recommended way, I think it would be good to support it too. Also it is useful for #8466.
#8466 (comment) might be related.
Reproduction
https://stackblitz.com/edit/vitejs-vite-mhmcjy?file=main.js
System Info
stackblitz
Vite: 2.9.9, 3.0.0-alpha.9
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
poyoho, silverwind, Vloz, dmitru, Lyokolux and 11 more
Metadata
Metadata
Assignees
Labels
feat: web workersinconsistencyInconsistency between dev & buildInconsistency between dev & buildpending triage