Skip to content

Mixin lazy loading failing with components #418

@KrishnaPG

Description

@KrishnaPG

A mixin loaded asynchronously inside a component, as below

const pagecontentAjaxMixin = resolve => require(['components/pagecontent-ajax-mixin'], resolve);
export default {
    mixins:[
        pagecontentAjaxMixin
    ],
}

is leading to errors

Property or method "xyz" is not defined on the instance but referenced during render

Doing a direct import of the mixin without the lazy-loading is working fine.

But direct import is injecting the mix-in code directly into component (and if we have multiple components it is found to be injected into all components, unnecessarily increasing the size).

Mixins, by definition are common code and would be great if they can be separate and asynchronously loaded (without having to statically inject the code into each component)

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