-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Warn About Duplicate Route Names #366
Comments
It should work as you say, so there must be some sort of bug. |
Found the bug. It was in our code. Someone created different routes for new and existing entities with the same name: config.map([
{ router: 'location/:id', name: 'location', ... },
{ router: 'location', name: 'location', ... }
]); It seems the last one wins, which then makes perfect sense. Should there be at least a warning when you use the same name for different routes? |
Probably. We hadn't considered that sort of mistake :) We can certainly add it. Can you create a new issue for that? Also, this sounds like a great opportunity for a community PR :) |
@EisenbergEffect we can re-open this issue if you want to track the warning issue? |
#377 has been merged and is published in 1.0.0 but it contains a critical bug! Apparently, the patch #377 trips on single routes that have multiple alternative URLs. This is a very hard regression, because the impact is that the application does not start at all. It is also a bit tricky to figure out, because the error message is clear, but doesn't say what route name is faulty... and when you look at your code, there is no duplicate names. /cc @devanp92 |
It's already fixed. We realized it during the release process and reverted that code entirely. |
Update to 1.0.2 |
can be closed.. maybe |
This is still an issue and a good one to track. |
I have the following route definition:
{ route: 'location/:id', name: 'location' }
But when I call
router.navigateToRoute('location', { id: 42 })
it navigates to:/location?id=42
.This does work for Aurelia, but it would be better if it went to the expected route:
/location/42
.Other components (and users) might look at the URL and this is a bit unexpected.
The text was updated successfully, but these errors were encountered: