Skip to content

Vue-router doesn't react on browser history back and forward #3804

@mbarouski

Description

@mbarouski

Version

3.6.5

Reproduction link

I can't provide it since I don't know how to stably reproduce the issue. Hope on some magical guess only.

Steps to reproduce

I have no idea how to reproduce it, even with my application I can't stably reproduce the issue. A couple of days ago I upgraded vue-router from 3.1.3 to 3.6.5 together with vue upgrade from 2.6.4 to 2.7.13. Also, I can see the issue only with the production build.

When the issue takes place, navigation guards beforeEach, beforeResolve, afterEach are not triggered.

⚠️ I noticed that I can stably reproduce the issue in new tab of browser, after refresh issue is not repeated, I will try to make a reproduction project.

UPD: When I use new tab, I use URL https://site.com and internal logic redirects me to https://site.com/en and at that moment router becomes broken for some reason. When I just refresh page, URL already contains locale prefix and router doesn't crash.

What is expected?

Vue-router always reacts on browser history back.

What is actually happening?

In some circumstances, vue-router stops reacting to browser history back, but <router-link>s (and hence router.push) continue working.


Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions