Skip to content
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

Catch-all route created with folder incorrect #190

Open
oujesky opened this issue Jan 18, 2025 · 1 comment · May be fixed by #191
Open

Catch-all route created with folder incorrect #190

oujesky opened this issue Jan 18, 2025 · 1 comment · May be fixed by #191

Comments

@oujesky
Copy link

oujesky commented Jan 18, 2025

Describe the Bug

There seems to be two options how to create a catch-all route

  1. src/pages/route/[...all].tsx -> route/* in router.ts
  2. src/pages/route/[...all]/index.tsx -> route/*/ in router.ts

The second route with a folder and index.tsx file seems to be generated with extra leading forward slash causing it to not be correctly matched afterwards

Generouted Version

1.19.10

Your Example Website or App or Reproduction

https://stackblitz.com/edit/github-stb4sxrx?file=src%2Fpages%2Fcatchall-file%2F%5B...all%5D.tsx

Steps to Reproduce the Bug or Issue

  1. create catch-all route with folder [...all] and page in file index.tsx
  2. Try to access that route

Expected Behavior

Route should be working and routed correctly

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Browser version: 131

Additional context

No response

@oujesky oujesky linked a pull request Jan 18, 2025 that will close this issue
@oujesky
Copy link
Author

oujesky commented Jan 18, 2025

I prepared a quick (& bit dirty) fix in #191, not sure if that's the right way

The thing is that after the catch-all part is replaced there is still the the /index part and that is ultimately replaced with /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant