Skip to content

Unable to merge options for navigation guard mixin to Vue component #2014

Closed
@ColinLaws

Description

@ColinLaws

Version

3.0.1

Reproduction link

https://jsbin.com/zaxupuj/edit?html,js

Steps to reproduce

Create a file that exports an object containing an in-component navigation guard for beforeRouteEnter. The code contained within this guard does not effect the issue from occurring. Create a Vue component, register it, and then on that Vue component, attempt to use that mixin. Also make sure that you are using vue-router as a plugin, and that the component that you are navigating to with your vue-router is the vue component that you added the mixin with the naviation guard to.

What is expected?

I expected the beforeRouteEnter guard to be executed as if it had existed within the Vue component that I was navigating to using vue-router.

What is actually happening?

I am encountering an exception when Vue is attempting to call checkComponent with 'TypeError: options is undefined'. Here is a stack trace if it helps.

checkComponents@http://twidur.com/js/app.js:23199:1 mergeOptions@http://twidur.com/js/app.js:23320:5 mergeOptions@http://twidur.com/js/app.js:23336:16 initExtend/Vue.extend@http://twidur.com/js/app.js:26615:19 extractGuard@http://twidur.com/js/app.js:3175:11 extractGuards/guards<@http://twidur.com/js/app.js:3159:17


(1) This is my first issue I've submitted, sorry if it is not structured the way you like Evan, I know you're picky.

(2) This issue existed before and was fixed with Pull request #1521 on Jun 28, 2017

(3) If my JSBin is garbage, I do apologize! Never used that either, I usually don't make these types of reports because Vue is so well built :)

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