-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Environment
- Operating System: Linux
- Node Version: v20.19.4
- Nuxt Version: 3.18.1
- CLI Version: 3.27.0
- Nitro Version: 2.12.4
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, modules, ui, colorMode, css, formkit, pinia, components, ssr, typo3
- Runtime Modules: @nuxt/[email protected], @pinia/[email protected], @t3headless/[email protected], @formkit/[email protected], @nuxtjs/[email protected], @nuxt/test-utils/[email protected], [email protected]
- Build Modules: -
Reproduction
See https://github.com/andreaswolf/nuxt-issue-repro
Run yarn run vitest --project=e2e for a working test, yarn run vitest --project=e2e-nuxt will not work.
Describe the bug
Tests run fine without Nuxt/defineVitestProject. As soon as I use defineVitestProject(), there are two errors and the tests are not run anymore:
-
Error: Failed to import test file /home/aw/Kunden/fes/fes-cp-v11/frontend-v2/node_modules/@nuxt/test-utils/dist/runtime/browser-entry.mjs
Caused by: SyntaxError: The requested module '/node_modules/qs/lib/index.js?v=c5ced9fb' does not provide an export named 'default' -
TypeError: Cannot set properties of undefined (setting 'PROD')
The second issue (very likely) comes from setupEnv in vitest's setup-common.js. I can also open a separate issue for this.
Additional context
No response