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

Vitest web-worker receives error when using together with happy dom #2446

Closed
6 tasks done
kalvenschraut opened this issue Dec 6, 2022 · 2 comments
Closed
6 tasks done

Comments

@kalvenschraut
Copy link
Contributor

Describe the bug

When either importing the file in the test suite or adding as a setupFile, @vitest/web-worker receives

TypeError: The URL must be of scheme file
 ❯ ESMLoader.import https:/nodewxgfq4-wbsv.w-credentialless.staticblitz.com/blitz.8cf5a3c77f45c942df800a39619ec49fff7e5814.js:6:1209050
 ❯ VitestRunner.interopedImport file:/home/projects/node-wxgfq4/node_modules/vitest/dist/chunk-vite-node-source-map.61c5ea66.js:329:17
 ❯ VitestRunner.directRequest file:/home/projects/node-wxgfq4/node_modules/vitest/dist/chunk-vite-node-source-map.61c5ea66.js:235:24

This may be an issue with happy-dom instead, starting here and will make an issue with them if it is.

Reproduction

https://stackblitz.com/edit/node-wxgfq4?file=test/suite.spec.ts

System Info

whatever stackblitz uses

Used Package Manager

npm

Validations

@kalvenschraut kalvenschraut changed the title Vitest web-worker receives error in happy dom Vitest web-worker receives error when using together with happy dom Dec 6, 2022
@kalvenschraut
Copy link
Contributor Author

kalvenschraut commented Dec 6, 2022

Traced down the issue, pretty sure it is just that happy-dom URL implementation doesn't support the base parameter. That vite node is utilizing here

https://github.com/capricorn86/happy-dom/blob/master/packages/happy-dom/src/location/URL.ts#L23

@kalvenschraut
Copy link
Contributor Author

see capricorn86/happy-dom#569

@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant