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

fix(nuxt): ensure url is not empty string #4781

Merged
merged 1 commit into from
May 5, 2022
Merged

fix(nuxt): ensure url is not empty string #4781

merged 1 commit into from
May 5, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented May 3, 2022

πŸ”— Linked issue

nuxt/nuxt#13906

Reproduction: https://stackblitz.com/edit/nuxt-starter-mc3z36

❓ 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

We detect redirection happens when after router middleware, initialURL is mismatching current route's fullPath. While initialURL from req.url is /, fullPath is an empty string due to a vue-router bug. Additionally, I've added '' to '/' fallback for navigateTo to ensure this issue won't happen in other places when calling router.resolve

Other than workaround for upstream issue, this PR tries to improve path compare to avoid unnecessary navigations.

πŸ“ Checklist

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

@pi0 pi0 self-assigned this May 3, 2022
@netlify
Copy link

netlify bot commented May 3, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 11843fe
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/627170da1ec4c90008563a0a

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants