-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Routes formatted as $foo-bar
are being prioritised over routes formatted as foo-bar
.
#11159
Comments
For additional context: We are aware that the behaviour of In our case, we're building out an e-commerce site that uses different collection page templates depending on the route suffixes. We have:
Before realising this was a thing, we were originally loading all collection templates into the The only issue we're running into is that we have a SEO heavy index page on |
Unfortunately, it's not It's not intended behavior - the behavior itself is the bug. Dynamic segments (named parameters) are required to be the full URL segment. Partial named parameters are not supported (they inadvertently worked for a small period of time, and were fixed in 6.5.0). This appears to be a bug due to an internal assumption that named parameters are only word characters (via an internal I'm going to transfer this over to an issue in React Router but to align with expected behavior, I would recommend avoiding the dash in the param name ( If you need to do this type of route/bundle spitting, I would do it via URL segment:
|
This is resolved by #11160 and will be fixed in the next release |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Reproduction
/pages/foo-bar
System Info
Used Package Manager
npm
Expected Behavior
In the case where there are routes using
pages.$foo-bar.tsx
andpages.foo-bar.tsx
routes, I would expect/pages/foo-bar
to match with thepages.foo-bar.tsx
file, not thepages.$foo-bar.tsx
file.Actual Behavior
When visiting
/pages/foo-bar
, thepages.$foo-bar.tsx
file is matched over thepages.foo-bar.tsx
file.The text was updated successfully, but these errors were encountered: