We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
globalThis.__vitest_broser_runner__ is not accessible within the scope of web workers, so vite's dynamic import wrapping is breaking via:
globalThis.__vitest_broser_runner__
Adding this hack to the top of the worker seems to fix the issue, but it's still a bug nonetheless:
I'm struggling to repro on StackBlitz due to browser mode incompatibilities on the web-based IDE.
Here's some links to my open source project where this applies:
To reproduce, start a web worker that contains a dynamic import...
// main.ts const worker = new Worker(new URL('./worker-file.js', import.meta.url), { type: 'module' }) // ... // worker-file.js const asset = await import('any-package-or-file')
System: OS: macOS 14.6.1 CPU: (10) x64 Apple M1 Max Memory: 24.88 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.17.0 - ~/.local/state/fnm_multishells/19453_1726068848957/bin/node Yarn: 1.22.21 - /usr/local/bin/yarn npm: 10.8.2 - ~/.local/state/fnm_multishells/19453_1726068848957/bin/npm pnpm: 9.4.0 - /usr/local/bin/pnpm bun: 1.1.26 - ~/.bun/bin/bun Watchman: 2024.05.06.00 - /usr/local/bin/watchman Browsers: Brave Browser: 128.1.69.168 Safari: 17.6 npmPackages: @vitest/browser: ^2.1.1 => 2.1.1 @vitest/coverage-v8: ^2.1.1 => 2.1.1 @vitest/ui: ^2.1.1 => 2.1.1 vitest: ^2.1.1 => 2.1.1
pnpm
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
globalThis.__vitest_broser_runner__
is not accessible within the scope of web workers, so vite's dynamic import wrapping is breaking via:Adding this hack to the top of the worker seems to fix the issue, but it's still a bug nonetheless:
Reproduction
I'm struggling to repro on StackBlitz due to browser mode incompatibilities on the web-based IDE.
Here's some links to my open source project where this applies:
To reproduce, start a web worker that contains a dynamic import...
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: