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
click "1", that will stay page "index", because run "next('/one')" in router.beforeEach().
click "2", that will go to page "two", because run "next()" in router.beforeEach().
click "back" button of the browser, back to page "index".
click "3", that will redirect "http://localhost:3001/one", then it will show "This page could not be found" error, also run "next('/one')" in router.beforeEach() by the way(wrong).
Thank you for the reproduction repo, it helps a lot.
In nuxt.js, we do some special stuff before mounting the app in SPA mode, so some things differs, also, we don't recommend to use router.beforeEach and using next because of our internal logic with fetch/asyncData.
Version
v1.0.0
Reproduction link
https://github.com/xachary/test-beforeeach-next
Steps to reproduce
See the README.md about Setup and Run please.
Bug in Nuxt:
Compare without Nuxt:
What is expected ?
The step 4 and 5 with Nuxt is same as the step 4 and 5 without Nuxt.
What is actually happening?
It will show "This page could not be found" error in the step 4 and 5 in with Nuxt.
Additional comments?
When error, in client.js:424 (case 18:), the router.currentRoute is always '/', not the target route path.
The text was updated successfully, but these errors were encountered: