-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Inline worker code incompatibility with Playwright’s WebKit #19238
Comments
Fixing on Vite side makes sense to me. vite/packages/vite/src/node/plugins/worker.ts Line 336 in c0f72a6
|
Having the same problem. Did you find any workaround that we could use until it is fixed? @lozinsky |
Unfortunately, no 😞 |
@sapphi-red you mentioned adding |
@aKzenT |
thanks for the clarification, I didn't realize that "classic" workers are still the default in vite. So although our project was configured for ESM, the workers were not using it. So in my case the 'workarround' is simply to switch to module workers:
|
Describe the bug
The current implementation of inline workers generated by Vite is not compatible with Playwright’s WebKit browser. Specifically, the
WorkerWrapper
code fails when trying to create workers using a Blob URL in WebKit, leading to errors during tests.The code in question is as follows:
The issue arises because the code attempts to immediately revoke the Blob URL in the
finally
block:This behavior invalidates the Blob URL before the worker can properly utilize it. Playwright’s WebKit (and likely other WebKit browsers) require the Blob URL to remain valid for the worker’s lifecycle, and prematurely revoking it causes failures. microsoft/playwright#33794 (comment)
What do you think, should it be fixed on the Vite side?
Reproduction
https://github.com/lozinsky/vite-inline-worker-playwright-webkit
Steps to reproduce
No response
System Info
System: OS: macOS 15.2 CPU: (8) arm64 Apple M1 Pro Memory: 189.03 MB / 16.00 GB Shell: 3.7.1 - /opt/homebrew/bin/fish Binaries: Node: 20.12.2 npm: 10.5.0 Browsers: Chrome: 131.0.6778.265 Safari: 18.2 npmPackages: vite: 6.0.8 => 6.0.8
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: