Vue Router warning when page / is not defined
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 120
- Avg merge
- 22h 52m
- Merged PRs (30d)
- 23
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction at github.com/JBustin/nuxt3-test-utils and the failing components/Header.nuxt.spec.ts test. Investigate test startup when no / page exists, along with the requested ability to mock the current route. Done means the test no longer emits the Vue Router or Nuxt page-not-found warnings and route mocking works for the described behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxtjs, typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100