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

[Vue Router warn]: Discarded invalid param(s) "team_slug" when navigating. #1126

Closed
knolleary opened this issue Oct 24, 2022 · 2 comments · Fixed by #1129
Closed

[Vue Router warn]: Discarded invalid param(s) "team_slug" when navigating. #1126

knolleary opened this issue Oct 24, 2022 · 2 comments · Fixed by #1129
Assignees
Labels
area:frontend For any issues that require work in the frontend/UI bug Something isn't working needs-triage Needs looking at to decide what to do
Milestone

Comments

@knolleary
Copy link
Member

Current Behavior

We get the above warning when navigating around teams in the UI.

It is triggered by calls like this:

this.$router.push({
    name: 'Team',
    params: {
       team_slug: this.team.slug
    }
})

However, that route is defined like this:

{
        path: '/team/:team_slug',
        redirect: to => {
            return `/team/${to.params.team_slug}/overview`
        },
        name: 'Team',
        component: Team,
        ....
}

I must be missing something here, because the warning is complaining that the route doesn't define a team_slug param, but yet it clearly does. Must be something more subtle I'm missing.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • FlowForge version:
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:
@knolleary knolleary added the needs-triage Needs looking at to decide what to do label Oct 24, 2022
@knolleary
Copy link
Member Author

Posted to vue forum for help on this as I cannot make sense of it: https://forum.vuejs.org/t/discarded-invalid-param-s-warning-yet-params-are-defined-in-path/133328

@knolleary knolleary added bug Something isn't working area:frontend For any issues that require work in the frontend/UI labels Oct 24, 2022
@knolleary knolleary added this to the 1.0 milestone Oct 24, 2022
@knolleary knolleary self-assigned this Oct 25, 2022
@knolleary
Copy link
Member Author

Having added some debug to vue-router, I can see the location it is testing against is:

{
    "name": "Project",
    "params": {
        "team_slug": "dev",
        "id": "ac8e4995-cb47-42ec-a9a4-71c42366c7f3"
    }
}

... even though I'm on the 'Team' view, something is asking it to route to the 'Project' view (which doesn't have team_slug as a defined param, hence the warning)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend For any issues that require work in the frontend/UI bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant