Skip to content

Vue Router warning when page / is not defined #1366

@JBustin

Description

@JBustin

Environment


  • Operating System: Darwin
  • Node Version: v22.14.0
  • Nuxt Version: 3.17.7
  • CLI Version: 3.26.2
  • Nitro Version: 2.12.2
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, modules
  • Runtime Modules: @nuxt/test-utils/[email protected]
  • Build Modules: -

Reproduction

https://github.com/JBustin/nuxt3-test-utils

Sorry, I would like to share a reproduction on Stackblitz, but I failed to get an effective install of nuxt3 + @nuxt/test-utils: https://stackblitz.com/edit/nuxt-starter-mygjuknd?file=package.json

Describe the bug

If I don't have any / page, we experiment some router warnings during test.

stderr | components/Header.nuxt.spec.ts
[Vue Router warn]: No match found for location with path "/"

stderr | components/Header.nuxt.spec.ts
[Vue Router warn]: No match found for location with path "/"

stderr | components/Header.nuxt.spec.ts
[nuxt] error caught during app initialization H3Error: Page not found: /

Additional context

Additionally, we expect to be able to mock the current route during the tests, because we have some different behavior regarding the format of the current route.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions