New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extendPages not resolving component #1105
Labels
enhancement
New feature or request
Comments
A workaround can be used in
instead of using |
For nuxt 2, Therefore, extendPages((pages, resolve) => {
pages.unshift({
path: '/locale',
- file: resolver.resolve('../Locale/Locale.vue'),
+ component: resolver.resolve('../Locale/Locale.vue'),
});
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Darwin
v18.18.2
2.17.3
3.10.0
2.8.1
[email protected]
webpack
bridge
,modules
,serverHandlers
,devServerHandlers
,devServer
,typescript
,nitro
,buildModules
@/modules/addLocale.ts
()
,@nuxt/[email protected]
Reproduction
Stackblitz: https://stackblitz.com/edit/github-nafqpn?file=modules%2FaddLocale.ts
Repo: https://github.com/yanniznik/nuxt-bridge-extendPages
modules
yarn dev
$nuxt.$router.options.routes
/Locale
and get 404 instead of componentDescribe 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 acomponent
attachedExpected: the
component
is attached to the route so that it can be loaded normallyAdditional context
The exact same setu in Nuxt3 works.
/Locale
is apccessibleExample 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
The text was updated successfully, but these errors were encountered: