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

@nuxt/test-utils-edge doesn't work with vitest v0.24.0 or later #15404

Closed
e-chan1007 opened this issue Nov 8, 2022 · 0 comments · Fixed by nuxt/framework#8815
Closed

@nuxt/test-utils-edge doesn't work with vitest v0.24.0 or later #15404

e-chan1007 opened this issue Nov 8, 2022 · 0 comments · Fixed by nuxt/framework#8815

Comments

@e-chan1007
Copy link

e-chan1007 commented Nov 8, 2022

Environment

  • Nuxt Version: 3.0.0-rc.13
  • @nuxt/test-utils-edge Version: latest(3.0.0-rc.14-27796957.b60f136)
  • Vitest Version: ^0.24.0

Reproduction

https://stackblitz.com/edit/github-raxmub-uprd1m?file=package.json

Describe the bug

With vitest@^0.24.0 or the latest 0.25.0, nuxt test will fail, and the following error occurs:

Cannot find module '/path/to/project/node_modules/vitest/dist/node.mjs' imported from /path/to/project/node_modules/@nuxt/test-utils-edge/dist/index.mjs

We should import vitest/dist/node.js rather than vitest/dist/node.mjs.

Additional context

The extension once changed to .mjs in vitest-dev/vitest@692ad34 , but in vitest-dev/vitest#1411 it was reverted and now using .js.

This PR(vitest-dev/vitest#1411) was merged and released as v0.24.0 so using v0.23.4 or former can also resolve this issue, but I can't see it as the best way.

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants