-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Labels
Description
Environment
- Operating System: `Linux`
- Node Version: `v22.19.0`
- Nuxt Version: `4.2.0`
- CLI Version: `3.29.3`
- Nitro Version: `2.12.8`
- Package Manager: `npm@10.9.3`
- Builder: `-`
- User Config: `modules`, `app`, `css`, `runtimeConfig`, `future`, `compatibilityDate`, `nitro`, `typescript`, `postcss`, `eslint`
- Runtime Modules: `@nuxt/eslint@0.7.6`
- Build Modules: `-`
Reproduction
https://stackblitz.com/edit/github-1hgk7l8y?file=test%2Fapp.e2e.spec.ts
- Create new Nuxt 4 project
- Install @nuxt/test-utils v3.20.1
- Create minimal e2e test
import { createPage, setup } from '@nuxt/test-utils/e2e'
import { test } from 'vitest'
await setup()
test('should run without error', async () => {
await createPage('/')
}, 5000)
- Run test
npx vitest
Describe the bug
FAIL node ../test/e2e/app.e2e.spec.ts [ test/e2e/app.e2e.spec.ts ]
Error: [commonjs--resolver] Transform failed with 1 error:
(define name):1:0: ERROR: Expected identifier but found "false"
file: /home/marco/projects/nuxt-test-utils-example/node_modules/nuxt/dist/app/entry.js
❯ failureErrorWithLog ../node_modules/esbuild/lib/main.js:1467:15
❯ ../node_modules/esbuild/lib/main.js:736:50
❯ responseCallbacks.<computed> ../node_modules/esbuild/lib/main.js:603:9
❯ handleIncomingPacket ../node_modules/esbuild/lib/main.js:658:12
❯ Socket.readFromStdout ../node_modules/esbuild/lib/main.js:581:7
Additional context
The test immediately fails. With @nuxt/test-utils v3.19.2 it works without issues.