-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add note about beforeFiles continuing #27211
Conversation
#26795 is about rewrites looping through all |
@threehams looking at the reproduction provided in the mentioned issue the I added this note to mention the continuing behavior of |
Let me see if I can get you a better reproduction. Should I comment on the same issue or open a new one? |
The existing reproduction explains the issue correctly, it's not a bug and is meant to match that way for a dynamic route. If you were to set this line to If you were to change this line to point to a non-dynamic page instead it would also work since non-dynamic pages are checked before Let me see if I can tweak this doc to explain this order a bit more |
@threehams I opened an additional PR here adding some additional context, let me know if this helps clear it up some more or if it could use some more information to help make this more clear |
This expands on #27211 and lists the full routes order used in Next.js to allow more exact matching when leveraging the different rewrite priorities. ## Documentation / Examples - [x] Make sure the linting passes
This adds a note explaining that `beforeFiles` continue instead of checking the filesystem/dynamic routes immediately like they do in `afterFiles` and `fallback`. ## Documentation / Examples - [x] Make sure the linting passes Closes: vercel#26795
This expands on vercel#27211 and lists the full routes order used in Next.js to allow more exact matching when leveraging the different rewrite priorities. ## Documentation / Examples - [x] Make sure the linting passes
This adds a note explaining that
beforeFiles
continue instead of checking the filesystem/dynamic routes immediately like they do inafterFiles
andfallback
.Documentation / Examples
Closes: #26795