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

0.26.1 failed to load url of virtual module on Windows #2548

Closed
6 tasks done
kingyue737 opened this issue Dec 21, 2022 · 3 comments · Fixed by #2619
Closed
6 tasks done

0.26.1 failed to load url of virtual module on Windows #2548

kingyue737 opened this issue Dec 21, 2022 · 3 comments · Fixed by #2619

Comments

@kingyue737
Copy link
Contributor

Describe the bug

No such issue for Linux

Clone the repo and run on Windows

pnpm install
pnpm run test

Test will fail with the following error:

 FAIL  test/pages.test.ts [ test/pages.test.ts ]
Error: Failed to load url D:/webprojects/vitest-pages-bug/@vite-plugin-pages/route-block (resolved id: D:/webprojects/vitest-pages-bug/@vite-plugin-pages/route-block). Does the file exist?
 ❯ loadAndTransform node_modules/.pnpm/vite@4.0.2_@types+node@18.11.17/node_modules/vite/dist/node/chunks/dep-6305614c.js:40425:21

Reproduction

https://github.com/kingyue737/vitest-pages-bug

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (6) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
    Memory: 3.67 GB / 15.86 GB
  Binaries:
    Node: 16.15.1 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.11.0 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (108.0.1462.46)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitejs/plugin-vue2: ^2.2.0 => 2.2.0
    vite: latest => 4.0.2
    vitest: latest => 0.26.1

Used Package Manager

pnpm

Validations

@robinlieson92
Copy link

Any update on this issue?

@sheremet-va
Copy link
Member

sheremet-va commented Dec 26, 2022

Any update on this issue?

I personally can't work on it until January 2nd. If someone else wants to try and fix it, go ahead 👍

@moishinetzer
Copy link

I'm currently having a very similar issue to this! I believe it's something to do with the way files are being resolved in Windows.

I have pretty much the same config except I have the following in my vitest.config.ts:

plugins: [react(), tsconfigPaths()],

For me, when I have the above, none of the tests are resolved / found and the RUN statement returns completely blank. Meaning here is an example full output:

 RUN  v0.26.2 /home/moishi/projecttest

Followed by blank, meaning the default command prompt.

After commenting out tsconfigPaths, my tests show like this:

 RUN  v0.26.2 /home/moishi/capply

 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/locations.test.ts (0)
 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/locations.test.ts (0)
 ❯ test/unit/utils/filter-query.test.ts (0)
 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/locations.test.ts (0)
 ❯ test/unit/utils/filter-query.test.ts (0)
 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/locations.test.ts (0)
 ❯ test/unit/utils/filter-query.test.ts (0)
 ❯ test/unit/services/shipments.test.ts (0)
 ❯ test/unit/services/locations.test.ts (0)
 ❯ test/unit/utils/filter-query.test.ts (0)
...

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 34 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  test/unit/utils/sort-query.test.ts [ test/unit/utils/sort-query.test.ts ]
 FAIL  test/unit/services/currency.test.ts [ test/unit/services/currency.test.ts ]
 FAIL  test/unit/services/shipments/find.test.ts [ test/unit/services/shipments/find.test.ts ]
 FAIL  test/unit/services/organizations/create.test.ts [ test/unit/services/organizations/create.test.ts ]
 FAIL  test/unit/utils/assert.test.ts [ test/unit/utils/assert.test.ts ]
 FAIL  test/unit/utils/order.test.ts [ test/unit/utils/order.test.ts ]
Error: Failed to load url ~test/unit/setup/matchers (resolved id: ~test/unit/setup/matchers). Does the file exist?
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-2285ba4f.js:40373:21

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/34]⎯

 Test Files  34 failed (34)
      Tests  no tests
   Start at  00:17:55
   Duration  13.83s (transform 237ms, setup 0ms, collect 0ms, tests 0ms)

Which is what leads me to think it's a weird windows resolve path situation.

This is both happening to me on my Windows machine and funnily enough also on my WSL machine, however on a regular Linux server the project tests 100% ok.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 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

Successfully merging a pull request may close this issue.

4 participants