test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

Test fails if useNuxtApp used

Open martinsjek opened this issue 1 year ago • 4 comments

Environment

  • Operating System: Linux
  • Node Version: v18.19.0
  • Nuxt Version: 3.9.3
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-vy6psx-sn3lfr

Describe the bug

[Vue warn]: Cannot mutate <script setup> binding "nuxtApp" from Options API. at <MountSuspendedComponent > at <MountSuspendedHelper> at <Anonymous ref="VTU_COMPONENT" > at <VTUROOT> [Vue warn]: Unhandled error during execution of render function at <MountSuspendedComponent > at <MountSuspendedHelper> at <Anonymous ref="VTU_COMPONENT" > at <VTUROOT>

I get this error message whenever I try to use useNudxtApp() in a component. Before the merge of nuxt-vitest and @nuxt/text-utils, this worked fine.

Additional context

Tests can be ran with: npm run test ./pages/tests/index.spec.ts

Logs

No response

martinsjek avatar Jan 29 '24 12:01 martinsjek