nested router - doesnt work
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.14.2
- Nuxt Version:
3.0.0-27460146.2ad93eb
- Package Manager:
npm@7.17.0
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-zvowq4-gj7iuh?file=pages/index.vue
Describe the bug
with latest version of nuxt 3 and follow the documentation i cant create nested route when i’m trying to get data from api i get error:
handle is not a function
at eval (file://./node_modules/h3/dist/index.mjs:57:24)
at new Promise (<anonymous>)
at callHandle (file://./node_modules/h3/dist/index.mjs:54:10)
at eval (file://./node_modules/h3/dist/index.mjs:50:12)
at eval (file://./node_modules/h3/dist/index.mjs:78:34)
at async handle (file://./node_modules/h3/dist/index.mjs:318:19)
at async ufetch (file://./node_modules/unenv/runtime/fetch/index.mjs:22:17)
at async $fetchRaw2 (file://./node_modules/ohmyfetch/dist/chunks/fetch.mjs:144:20)
at async setup (file://./.nuxt/dist/server/server.mjs:2442:176)
[Vue Router warn]: No match found for location with path "/test"
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:11 (1 by maintainers)
Top Results From Across the Web
React Router v6 Nested Routes doesn't work - Stack Overflow
Nested Route components need an Outlet component to be rendered into. Apply either of the following: Have Information component render the ...
Read more >The Guide to Nested Routes with React Router - ui.dev
In this comprehensive, up-to-date guide, you'll learn everything you need to know about creating nested routes with React Router.
Read more >React Router and nested routes - Kevin Farrugia
In my own words, a nested route is a region within a page layout that responds to route changes. For example, in a...
Read more >How to Use Nested Routes in React Router 6
It is standard practice to import BrowserRouter as Router because BrowserRouter is too long to type! Basic Routing. From here you can begin...
Read more >react router v6 nested routes not working - You.com
Nested routing is not working in React Router v6 ... 4 Answers. The default behavior of React Router fails to render multiple child...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For now, you can workaround this with:
@ahku As of right now you can not. The handler is working only for the file-system path no matter if you use
useBase
or not. Currently defining programmatic routes is not possible this way. The only mean I am aware of to programmatically define routes is by using server middleware and handlingreq
/res
yourself.Edit, scratch that. @danielroe code is perfectly fine, but you must use catch-all:
Edit 2, you can not use root (
/
) path in nested router when using catch-all ([...].ts
) 😅