Skip to content

Navigating from router-view throws Missing required param #845

Closed
@phillduffy

Description

@phillduffy

Version

4.0.5

Reproduction link

https://github.com/phillduffy/route-issue

Steps to reproduce

  • Run the repo
  • Navigate to 'Child with Param'
  • Click 'Back Home'

What is expected?

User should navigate back to the home page

What is actually happening?

Exception is being thrown

runtime-core.esm-bundler.js:38 [Vue warn]: Unhandled error during execution of watcher callback at <RouterLink to= {name: "grandchild"} > at <Child onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {…} > > at <RouterView> at <Home onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {…} > > at <RouterView> at <App>

and

Uncaught (in promise) Error: Missing required param "id" at Object.stringify (vue-router.esm-bundler.js:994) at Object.resolve (vue-router.esm-bundler.js:1410) at Object.resolve (vue-router.esm-bundler.js:2860) at vue-router.esm-bundler.js:2039 at ComputedRefImpl.reactiveEffect [as effect] (reactivity.esm-bundler.js:42) at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:828) at vue-router.esm-bundler.js:2041 at ComputedRefImpl.reactiveEffect [as effect] (reactivity.esm-bundler.js:42) at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:828) at vue-router.esm-bundler.js:2064


Updating the grandchild link to the following gets around the issue

<router-link :to="{ name: 'grandchild', params: { id: 1 } }" >Grandchild</router-link >

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas workaroundA workaround has been found to deal with the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions