Closed ferretwithaberet closed 7 months ago
@ferretwithaberet That's mainly react-router
matching for the routes config, you could see a related warning the devtools console — tbh that's kind of expected but feel free to report there if you find it an issue.
To get around that, you could try:
src/pages/segment1.segment2/index.tsx
to skip segment1
matchingsrc/pages/segment1/segment2/index.tsx
if you need to add routes at src/pages/segment1/
Here's the updated example I've tested: https://stackblitz.com/edit/vitejs-vite-7e9xxf?file=src%2Fpages%2Fseg1.seg2.tsx
Hope that helps.
Describe the Bug
Folders without an index file create empty routes
Generouted Version
1.18.5
Your Example Website or App or Reproduction
https://stackblitz.com/edit/vitejs-vite-jbnrwj?file=src%2Fpages%2Findex.tsx&terminal=dev
Steps to Reproduce the Bug or Issue
/segment1
, observe that the router matches and an empty page is shown, even though there is noindex.tsx
Expected Behavior
When navigating to
/segment1
, it should show the 404 page.Screenshots or Videos
No response
Platform
Additional context
No response