Skip to content

NavigationDuplicated on navigating to the same page with different params (confirmed) #3013

@orrd

Description

@orrd

Version

3.1.3

Reproduction link

https://codesandbox.io/s/vue-template-ujrqt

Steps to reproduce

  • Configure a route with any static path and also set props: true

  • Call this.$router.push() on that route with params set to some value.

  • Call this.$router.push() on that route with params set to some other value.

  • A NavigationDuplicated error is thrown even though the params are different.

What is expected?

A route push should not be considered NavigationDuplicated if the params are different.

What is actually happening?

A NavigationDuplicated is generated even though the params are different.


Yes, this is the same issue as #2884 and also mentioned by others, but this is confirming it with the reproduction example. I think the reason why @posva wasn't able to reproduce it is he may have used the param as part of the path, which does cause this issue not to happen. But params aren't always used in the path, sometimes the params are used as props for the component (https://router.vuejs.org/guide/essentials/passing-props.html#boolean-mode).

I would also like to re-propose the same solution that some others have suggested in the comments of the other issues of adding an option to turn off NavigationDuplicated errors entirely. It's clear that NavigationDuplicated errors aren't wanted by a large number of Vue-Router users. If the option to turn off NavigationDuplicated errors isn't enabled by default, adding that option wouldn't be a breaking change, so that can be implemented in the current 3.x versions without waiting for 4.x.

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