Skip to content
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(vue-app): check whether route exists within Nuxt app before replacing #9431

Merged
merged 2 commits into from Jun 14, 2021

Conversation

danielroe
Copy link
Member

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)

Description

Fixes redirection issue introduced in #9050

Checklist:

  • All new and existing tests are passing.

@danielroe danielroe requested review from pi0 and clarkdo June 14, 2021 12:45
@pi0 pi0 merged commit 35c6ac4 into dev Jun 14, 2021
@pi0 pi0 deleted the fix/avoid-blind-url-replacement branch June 14, 2021 13:54
pi0 pushed a commit that referenced this pull request Jun 14, 2021
@pi0 pi0 mentioned this pull request Jun 15, 2021
@pabloalvzal
Copy link

Hello @danielroe @pi0

I am migrating our company's web client to Nuxt and I may have found a bug on the latest version (bug fix). I was working on Nuxt 2.15.6 and just did the upgrade to 2.15.7.

It seems that on normal route navigation, all things work well! But on page reload the forward slash / gets replaced in the route by %2F. In our case, this leads to 404's because we use the URL to build the API call.

I can probably work around it by validating the API call everytime, but I thought I should let you know.

@danielroe
Copy link
Member Author

@pabloalvzal Could you provide a bit more info on the situation in a new issue?

@Sendoo Sendoo mentioned this pull request Jun 16, 2021
@joaquinvexels
Copy link

Hello @danielroe @pi0

I am migrating our company's web client to Nuxt and I may have found a bug on the latest version (bug fix). I was working on Nuxt 2.15.6 and just did the upgrade to 2.15.7.

It seems that on normal route navigation, all things work well! But on page reload the forward slash / gets replaced in the route by %2F. In our case, this leads to 404's because we use the URL to build the API call.

I can probably work around it by validating the API call everytime, but I thought I should let you know.

same

@curtgrimes
Copy link
Contributor

curtgrimes commented Jun 21, 2021

I'm experiencing a redirect loop on this update compared to the last patch release (redirecting from path ending in no slash to slash to no slash etc. until browser stops the redirect loop) but I do not have time at the moment to create a minimal reproduction.

@mvandiest
Copy link

mvandiest commented Jul 2, 2021

Hello @danielroe @pi0

I am migrating our company's web client to Nuxt and I may have found a bug on the latest version (bug fix). I was working on Nuxt 2.15.6 and just did the upgrade to 2.15.7.

It seems that on normal route navigation, all things work well! But on page reload the forward slash / gets replaced in the route by %2F. In our case, this leads to 404's because we use the URL to build the API call.

I can probably work around it by validating the API call everytime, but I thought I should let you know.

Also seeing the %2f issue on page reload.

Copy link
Member Author

@mvandiest Is this replicable in nuxt-edge as well?

@darioferderber
Copy link
Contributor

Hi @pi0, @danielroe,

I'm having trouble with routes that have defined aliases after upgrading to 2.15.7 from 2.15.6.

Route example:

{
  name: 'Homepage',
  path: '/hr/',
  component: 'pages/Homepage.vue',
  chunkName: 'pages/Homepage',
  pathToRegexpOptions: {
    strict: true
  },
  alias: ['/en/']
},

If I navigate to '/en/' (with anchor tag) location gets replaced to '/hr/' (only on client side).

@ChristianAlbrecht
Copy link

ChristianAlbrecht commented Jul 27, 2021

Hello @danielroe @pi0

I am migrating our company's web client to Nuxt and I may have found a bug on the latest version (bug fix). I was working on Nuxt 2.15.6 and just did the upgrade to 2.15.7.

It seems that on normal route navigation, all things work well! But on page reload the forward slash / gets replaced in the route by %2F. In our case, this leads to 404's because we use the URL to build the API call.

I can probably work around it by validating the API call everytime, but I thought I should let you know.

We are also seeing this issue with slashes being replaced on page reload or direct navigation.
Normal route navigation still works fine, as also described by @pabloalvzal

A few more details.
This only seems to happen for a specific route, which has a named parameter, that can contain multiple levels of path segments. The corresponding path expression:

path: '/space/:repository([^]*)?/'

with 2.15.6 we get for repository something like folder/subfolder but after the update to 2.15.7 it is folder%2Fsubfolder. This also replaces our URL at that point, which leads to subsequent errors in our web application so that for now we reverted back to 2.15.6

@pi0 pi0 mentioned this pull request Aug 11, 2021
@danielroe danielroe added the 2.x label Jan 18, 2023
@danielroe danielroe mentioned this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants