Skip to content

import as Async component way with Vue.extend beforeRouteLeave throw error parentVal.concat is not a function #3004

Closed
@Bee777

Description

@Bee777

Version

3.0.3, also 3.1.3

Reproduction link

https://codesandbox.io/s/vue-template-1148z

Steps to reproduce

To see the error:

  1. Enter a page for the target route, not by $router.push but manually enter the url target and press enter on keyboard
  2. See error on browser console.

What is expected?

Get into the page as usually without the error.

What is actually happening?

When entered the page got the error:

vue-router.esm.js?8c4f:2079 TypeError: parentVal.concat is not a function
at mergeHook (vue.runtime.esm.js?2b0e:1272)
at mergeField (vue.runtime.esm.js?2b0e:1552)
at mergeOptions (vue.runtime.esm.js?2b0e:1543)
at Function.Vue.extend (vue.runtime.esm.js?2b0e:5153)


To make its work 3 ways:

  1. import as a normal not async way.
  2. combine import as a normal and import as async way.
  3. just remove the beforeRouteLeave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions