Skip to content

Vue Router warning when page / is not defined #1366

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: npm@11.2.0
  • Builder: -
  • User Config: compatibilityDate, devtools, modules
  • Runtime Modules: @nuxt/test-utils/module@3.19.2
  • 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.

Activity

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

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