-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Extension fails to fetch dynamically imported module #544
Comments
The same test launched from script works properly |
+1 |
I have the same problem. |
The "Output" field in this issue is not correct. It prints much more information, please don't crop it. Please read what the issue template says:
|
Hello @dlims. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with |
I will add "needs reproduction" label, but more output should be enough. I also need to know Vite and Vitest versions. |
I've added requested info. |
Maybe this is some incompatibility to latest vitest or vitest/browser? I suddenly have the same problem in all my projects, so I tested it in a small demo project I created for a past issue: https://github.com/kayahr/vitest-bugs-4 This demo project uses vitest 2.1.4 and I can't reproduce the problem there. But when I update vitest and vitest-browser dependency to 2.1.6 and restart vscode (or reload the tests) then I get the error: Downgrading to 2.1.4 fixes the problem. With 2.1.5 it also doesn't work so I guess the problem was introduced in vitest 2.1.5. Or vitest/browser 2.1.5 (as only the browser tests are affected) |
I am facing the same problem with Vite 6.0.1,Vitest 2.1.5 and 2.1.6. P.S. I am using Vitest browser mode. |
New vitest user here, but i can also confirm it works with 2.1.4 and not 2.1.6. |
Does this only happen with the browser mode? |
Describe the bug
Tests launched from test explorer in browser mode fail to load extension module.
Reproduction
Just trying to run a test in browser mode from test explorer produces this error:
TypeError: Failed to fetch dynamically imported module: http://localhost:63315/@fs/C:/Users/dlore/.vscode/extensions/vitest.explorer-1.8.1/dist/setupFile.mjs?import&browserv=1732438481928
Output
[11:01:08 AM] Initiating deferred test run
[INFO 11:01:08 AM] Running 1 file(s): src/core/unit-test-browser/VitestBrowserExample.spec.browser.ts
[11:01:08 AM] The runner is starting because tests src/core/unit-test-browser/VitestBrowserExample.spec.browser.ts were started due to a file change
[INFO 11:01:08 AM] [Worker] The request url "C:/Users/dlore/.vscode/extensions/vitest.explorer-1.8.1/dist/setupFile.mjs" is outside of Vite serving allow list
[Error 11:01:08 AM] Error in C:/Users/dlore/Github/bauhaus_master/src/core/unit-test-browser/VitestBrowserExample.spec.browser.ts TypeError: Failed to fetch dynamically imported module: http://localhost:63315/@fs/C:/Users/dlore/.vscode/extensions/vitest.explorer-1.8.1/dist/setupFile.mjs?import&browserv=1732615268915
[11:01:08 AM] Marking "VitestBrowserExample.spec.browser.ts [browser]" as failed with 1 errors
[11:01:08 AM] Marking "VitestBrowserExample.spec.browser.ts [browser]" as failed with 1 errors
[11:01:08 AM] Ending test run src/core/unit-test-browser/VitestBrowserExample.spec.browser.ts
[11:01:09 AM] [VSCODE] Ignoring file: node_modules.vite\vitest\bcfb0f9579ecec702e2da1067b249218\results.json
Version
Vitest Explorer: 1.8.1
Vite: 5.4.10
Vitest: 2.1.5
Validations
The text was updated successfully, but these errors were encountered: