Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented May 14, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#14117

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently if there is a catchall [...slug].vue and and index.vue in a directory, the index will never be hit. (There are also some other variants of this issue.

We can resolve by sorting lists of routes to put dynamic parameters at the end of the list.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working pages πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels May 14, 2022
@danielroe danielroe requested a review from pi0 May 14, 2022 13:37
@danielroe danielroe self-assigned this May 14, 2022
@netlify
Copy link

netlify bot commented May 14, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 530c4cd
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62a1e174178c700008a0c638

@danielroe danielroe changed the title fix(nuxt): sort routes with slugs at the end fix(nuxt): sort routes with dynamic params at the end May 14, 2022
@danielroe danielroe marked this pull request as draft May 20, 2022 12:09
@danielroe
Copy link
Member Author

I can't now reproduce this and wonder if it was originally reported as a side-effect of #5002.

@danielroe danielroe closed this May 20, 2022
@danielroe danielroe deleted the fix/sort-routes branch May 20, 2022 13:04
@danielroe danielroe restored the fix/sort-routes branch June 9, 2022 11:08
@danielroe danielroe reopened this Jun 9, 2022
@danielroe danielroe marked this pull request as ready for review June 9, 2022 11:08
@pi0
Copy link
Member

pi0 commented Jun 9, 2022

Since we already discussed, isn't it something vue-router has to automatically resolve using route scores? Update: Just saw nuxt/nuxt#14117. An upstream issue would be nice to track :)

@pi0
Copy link
Member

pi0 commented Jun 9, 2022

@danielroe Can you please check the failed test?

@pi0 pi0 merged commit b31186b into main Jun 9, 2022
@pi0 pi0 deleted the fix/sort-routes branch June 9, 2022 12:09
@pi0 pi0 mentioned this pull request Jun 10, 2022
danielroe added a commit that referenced this pull request Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage pages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[...slug] pages has higher priority in sub directories

3 participants