Skip to content

Late-injected options of constructors are dropped in resolveComponentOptions function #4976

Closed
@chanon

Description

@chanon

While investigating the cause of vuejs/vue-class-component#65 related to vue-hot-reload not working with vue-class-component, @ktsn found a bug in vue core which he noted here:
vuejs/vue-class-component#65 (comment)

He says

I find there is a bug in core library that accidentally drop late-injected options of constructors. That means, if we use vue-hot-reload-api or vue-loader, they inject some options into component options object after creating component constructors, then the component is instantiated by using constructor with $createElement and the injected options are dropped in resolveComponentOptions function.

And that it is also causing vuejs/vue-class-component#66

Here is the minimal reproduction of this bug by @ktsn
https://jsfiddle.net/vvxLyLvq/2/

I don't know much about it, I'm just creating the issue here for @ktsn

In summary this issue is causing vue-class-component hot-reload to not work and also makes using vue-class-component with CSS Modules impossible.

Thank you!

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

        Participants

        @chanon@yyx990803

        Issue actions

          Late-injected options of constructors are dropped in resolveComponentOptions function · Issue #4976 · vuejs/vue