Git Product home page Git Product logo

Comments (14)

IsraelOrtuno avatar IsraelOrtuno commented on June 17, 2024 1

This happened to me in the past when including characters like / or + too. Not sure if this is a regression but these issues mention it:

#14316
#15738

from nuxt.

danielroe avatar danielroe commented on June 17, 2024 1

Yes - and let's add a comment there.

from nuxt.

abovedave avatar abovedave commented on June 17, 2024 1

FWIW I think #26519 is what introduced the bug in 3.11.2. Specifically this line:

} else if (import.meta.server && to.fullPath !== initialURL && (to.redirectedFrom || !isSamePath(to.fullPath, initialURL))) {
await nuxtApp.runWithContext(() => navigateTo(to.fullPath || '/'))
}

In my testing on Netlify given an example dynamic path /post/1?foo=bar/, the nuxtApp.ssrContext.url has encoded the query string, but the router fullPath does not:

initialURL = /post/1?foo=bar%2F
to.fullPath = /post/1?foo=bar/

Therefore the line !isSamePath(to.fullPath, initialURL) is returning true when it should be false. I was able to patch this by using decodeURIComponent(), although I'm not sure if that is the perfect solution here.

!isSamePath(to.fullPath, decodeURIComponent(initialURL)))

Perhaps Vercel and Netlify both encode values passed differently (encodeURIComponent vs encodeURI?), which might explain why a query string with + works on Netlify but not Vercel.

from nuxt.

danielroe avatar danielroe commented on June 17, 2024 1

Nice find - thank you @abovedave 🙏

from nuxt.

calbers-ew avatar calbers-ew commented on June 17, 2024 1

We are having a similar issue, but I'm not sure if it's exactly the same thing. A couple of questions...

  1. I tried the nightly build and the issue persisted, should that have worked? Would that actually be a temporary solve for this?
  2. our route works fine on localhost in a web browser, but we have some software that uses an integrated Edge browser, and it gets redirected infinitely there until a "too many redirects" error (using localhost as well). The query string that seems to cause it doesn't have any '/' or '+' characters (http://localhost:3000/?mode=light&ver=1.1.1.1&Mode=active&id=ffb738944d621ac08a1802c6a92ad5d69a625800&font=Segoe%20UI). Does this warrant its own issue, or does it seem similar enough?

from nuxt.

kmukku avatar kmukku commented on June 17, 2024 1

I've encountered this error before and it reappeared after an upgrade. This hotfix resolves the issue:

#14316 (comment)

from nuxt.

kakkokari-gtyih avatar kakkokari-gtyih commented on June 17, 2024

It was working fine until 3.11.1 and went wrong from 3.11.2, so it should be a recurrence

from nuxt.

manniL avatar manniL commented on June 17, 2024

cc @huang-julien might be related to the encoding? #26712 ?

from nuxt.

abovedave avatar abovedave commented on June 17, 2024

Similar thing happening on Netlify with /, + works though #26888

from nuxt.

huang-julien avatar huang-julien commented on June 17, 2024

I think we'll revert the encoding. wdyt @danielroe ?

from nuxt.

abovedave avatar abovedave commented on June 17, 2024

I was just looking to patch our site with the fix in #26893 until it's released, but it looks like the work which was reverted from #26712 hadn't even shipped yet and was scheduled for 3.12.0 - so I'm confused at the fix here, unless I missed something?

from nuxt.

kakkokari-gtyih avatar kakkokari-gtyih commented on June 17, 2024

You can use nightly version to for the patch, or you can also just downgrade to v3.11.1

https://nuxt.com/docs/guide/going-further/nightly-release-channel

from nuxt.

manniL avatar manniL commented on June 17, 2024

Re-opening here for further investigation (cc @danielroe)

from nuxt.

abovedave avatar abovedave commented on June 17, 2024

@calbers-ew if it's this bug causing your issue, downgrading to 3.11.1 should fix it for now.

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.