Comments (14)
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:
from nuxt.
Yes - and let's add a comment there.
from nuxt.
FWIW I think #26519 is what introduced the bug in 3.11.2. Specifically this line:
nuxt/packages/nuxt/src/pages/runtime/plugins/router.ts
Lines 254 to 256 in 5e2ec03
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.
Nice find - thank you @abovedave 🙏
from nuxt.
We are having a similar issue, but I'm not sure if it's exactly the same thing. A couple of questions...
- I tried the nightly build and the issue persisted, should that have worked? Would that actually be a temporary solve for this?
- 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.
I've encountered this error before and it reappeared after an upgrade. This hotfix resolves the issue:
from nuxt.
It was working fine until 3.11.1 and went wrong from 3.11.2, so it should be a recurrence
from nuxt.
cc @huang-julien might be related to the encoding? #26712 ?
from nuxt.
Similar thing happening on Netlify with /
, +
works though #26888
from nuxt.
I think we'll revert the encoding. wdyt @danielroe ?
from nuxt.
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.
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.
Re-opening here for further investigation (cc @danielroe)
from nuxt.
@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)
- Wrong link in the devtools when accessing private env
- Nuxt 3 - Nitro vercel-edge - Redirection problem on page load - URL parameter appended to URL HOT 3
- status of useLazyAsyncData for cached requests is success on router enter HOT 1
- Type "image/x-icon" for favicon missing from link types HOT 2
- header.location in Redirects is Double-Encoded in Nuxt v3.12.1 HOT 4
- Runtime config warning (typo error link) HOT 2
- NuxtLink with an external url gives vue router waring HOT 1
- Progressive Web App. HOT 2
- HMR with docker and apache proxy HOT 8
- State defined in a composable is not reactive when `ssr: false` HOT 2
- Massive amount of warnings with PrimeVue HOT 2
- nuxt 3.12 useState change detection fails when ssr is false HOT 2
- type error in `nuxt.config.ts` for app.head.link[] - definition for link not comaptible HOT 1
- useAsyncData's return type for data and error still is `| null` in v4 HOT 1
- The way dynamic route path is generated breaks usage with path-to-regexp HOT 5
- 'builder:watch' hook isn't released when nuxt.config is updated HOT 1
- WebSockets for dev server not respecting HTTPS HOT 1
- The route I customized in pages:extend cannot load the custom layout. HOT 4
- useState lost reactivity on `ssr: false` HOT 2
- `definePageMeta` breaks definition/compilation of inline JSX-components HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.