extendPages not resolving component
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 285
- Forks
- 33
- Avg merge
- 22h 38m
- Merged PRs (30d)
- 3
Description
Environment
- Operating System:
Darwin - Node Version:
v18.18.2 - Nuxt Version:
2.17.3 - CLI Version:
3.10.0 - Nitro Version:
2.8.1 - Package Manager:
yarn@1.22.19 - Builder:
webpack - User Config:
bridge,modules,serverHandlers,devServerHandlers,devServer,typescript,nitro,buildModules - Runtime Modules:
@/modules/addLocale.ts - Build Modules:
(),@nuxt/bridge@3.0.1-28459804.a0dceb3
Reproduction
Stackblitz: https://stackblitz.com/edit/github-nafqpn?file=modules%2FaddLocale.ts
Repo: https://github.com/yanniznik/nuxt-bridge-extendPages
- Add a module file and load it in nuxt.config.ts under
modules - Use the nuxt3 extendPages method to add a new route
yarn dev- in Chrome dev console, run
$nuxt.$router.options.routes - Go to
/Localeand get 404 instead of component
Describe the bug
Current: The page doesn't load (404 not found). The new "/Locale" route was added from a module using extendPage. Looking at the route object clearly shows that the route doesn't have a component attached
Expected: the component is attached to the route so that it can be loaded normally
Additional context
The exact same setu in Nuxt3 works. /Locale is apccessible
Example stablitz with Nuxt3, same setup: https://stackblitz.com/github/nuxt/examples/tree/main/examples/advanced/module-extend-pages?embed=1&file=pages/index.vue&theme=dark
Logs
No response
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
The reproduction is in modules/addLocale.ts; start by running yarn dev and inspecting $nuxt.$router.options.routes for /Locale. Compare Nuxt Bridge's extendPages behavior with the linked Nuxt 3 example. The work is done when the generated route includes its component and /Locale no longer returns 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100