-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(router): show default child if trailingSlash is false #6594
Conversation
I kept the failing tests because I'm not sure about the impact of the introduced change and love to get feedback on the PR.
|
The failing test seems to be an issue, adding the |
My check for |
Now only the missing route name is the difference which should be the right behavior. |
Codecov Report
@@ Coverage Diff @@
## dev #6594 +/- ##
==========================================
+ Coverage 62.69% 62.74% +0.04%
==========================================
Files 84 84
Lines 3394 3398 +4
Branches 926 928 +2
==========================================
+ Hits 2128 2132 +4
Misses 1018 1018
Partials 248 248
Continue to review full report at Codecov.
|
Ready for review |
Sorry for asking but why is deleting the name of the route the solution? It isnt something thats immediately obvious to me. |
@pimlie Valid question! As reported in #6593, there will be a vue router warning otherwise advising to do so.
|
Thanks. Isnt deleting the route name then strictly speaking resolving a consequence of an issue? Ie why are the route names duplicate in the first place? If it isnt solvable by fixing the duplicate route names, could we maybe add a comment explaining why we choose to fix it this way? |
I think its because of this replace: https://github.com/nuxt/nuxt.js/blob/dev/packages/utils/src/route.js#L64 Because of that |
007c785
to
a84f31d
Compare
Hi! Is there any chance to fix this bug soon? Could I help you somehow? |
Hi, any updates on this? Just FYI the issue also presents itself when Without the trailingSlash option my router.js routes looks like this:
With
Of course results in the following warnings:
|
Codecov Report
@@ Coverage Diff @@
## dev #6594 +/- ##
==========================================
+ Coverage 70.14% 70.17% +0.03%
==========================================
Files 88 88
Lines 3758 3762 +4
Branches 1020 1022 +2
==========================================
+ Hits 2636 2640 +4
Misses 912 912
Partials 210 210
Continue to review full report at Codecov.
|
Resolves #6593
The bug was introduced by setting
'/'
instead of''
for child routes whenrouter.trailingSlash
isfalse
:https://github.com/nuxt/nuxt.js/blob/e39f54b44e203f6c47100f8fd779f34345bac772/packages/utils/src/route.js#L184.
Types of changes
Checklist: