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

page infinitely loading in spa mode #490

Closed
divisey opened this issue Oct 16, 2019 · 1 comment · Fixed by #510
Closed

page infinitely loading in spa mode #490

divisey opened this issue Oct 16, 2019 · 1 comment · Fixed by #510
Assignees
Labels

Comments

@divisey
Copy link

divisey commented Oct 16, 2019

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.

This bug report is available on Nuxt community (#c322)
@ghost ghost added the cmty:bug-report label Oct 16, 2019
@rchl rchl added the bug 🐛 label Oct 16, 2019
@rchl rchl self-assigned this Oct 16, 2019
@rchl
Copy link
Collaborator

rchl commented Oct 25, 2019

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.

@rchl rchl closed this as completed in #510 Nov 7, 2019
rchl added a commit that referenced this issue Nov 7, 2019
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
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 a pull request may close this issue.

2 participants