./src/pages
├── [...all].tsx
└── blog
└── [...all].tsx
└── [id].tsx
When enter /blog/1 it display blog/[id].tsx, it's correct. But, when I enter /blog, it looks not fallback to catch all route(blog/[...all].tsx). Currently, it display nothing.
Case 2
./src/pages
├── [...all].tsx
└── blog
└── [id].tsx
When I enter /blog, it looks not fallback to catch all route([...all].tsx). Currently, it display nothing.
Maybe it's related to resolved routes data, when routes data looks like this will meet above issue.
{
path: 'blog'
children: [
{
path: '*'
}
]
}
The solution flat children routes(if parent route not found)
Describe the bug
Case 1
I have a project, pages dir looks like this:
When enter
/blog/1
it displayblog/[id].tsx
, it's correct. But, when I enter/blog
, it looks not fallback to catch all route(blog/[...all].tsx
). Currently, it display nothing.Case 2
When I enter
/blog
, it looks not fallback to catch all route([...all].tsx
). Currently, it display nothing.Maybe it's related to resolved routes data, when routes data looks like this will meet above issue.
The solution flat children routes(if parent route not found)
Reproduction
https://github.com/JiangWeixian/vite-plugin-pages-minirepo
System Info
Used Package Manager
pnpm
Validations