You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This bug triggers because now we are triggering all the language detection code on navigating in SPA mode while previously that was broken. So that fix uncovered this bug where due to an extra trailing slash we are not able to match the current page with an existing route.
This fixes bug that triggers in quite specific situation - SPA mode
with Vue-router set to use hash mode.
In that setup if user navigates directly to an URL that will trigger
certain route and that route's `path` does not *exactly* match the
path user navigated to (for example due to extra trailing slash
or query parameter in user's URL), that triggers redirect that fails
due to target route being the same. That leaves current route in a
broken state. I assume because that route wasn't committed yet.
Fix by comparing routes in more sophisticated way than just comparing
route's path. Instead use VueRouter to resolve route from path and then
compare that with current route.
Resolves#490
Version
v6.3.0
Reproduction link
https://github.com/divisey/nuxt-i18n-path-issue
Steps to reproduce
yarn
yarn dev
then visit http://localhost:3000/#/es/ in browser
What is expected ?
it should work well when url is either http://localhost:3000/#/es, http://localhost:3000/#/es/ or http://localhost:3000/#/es/?a=1
What is actually happening?
it works when url is http://localhost:3000/#/es, but page infinitely loading when you visit http://localhost:3000/#/es/, or when you have a
query like http://localhost:3000/#/es?a=1
Additional comments?
this issue does not appear in v6.0.0, maybe somewhere has a bug in the later version.
The text was updated successfully, but these errors were encountered: