Skip to content
This repository was archived by the owner on Mar 8, 2019. It is now read-only.
This repository was archived by the owner on Mar 8, 2019. It is now read-only.

Unable to import named mixin export #92

@patric-eberle

Description

@patric-eberle

I created the @verstaerker/vue-bem plugin. The plugin also provides a mixin as a named export. Unfortunately this seems not to work with vue-docgen-api (it does work inside the Vue application itself) and gives the following error:

Warning: Cannot parse app/components/e-heading.vue: Error: No suitable component definition found

It usually means that vue-docgen-api does not understand your source code or when using third-party libraries, try to file an issue here:
https://github.com/vue-styleguidist/vue-docgen-api/issues

The Plugin code

src/modules/mixin.js Holds the mixin code.

var mixin = {
  // ...
}
export default mixin;

src/index.js Creates the public exports.

export { default } from './modules/plugin';
export { default as bemMixin } from './modules/mixin';

The import

As described in the readme.

import { bemMixin } from '@verstaerker/vue-bem'

export default {
  mixins: [bemMixin],
  render(h) {
    const className = this.$bem('element');
    
    // ...
  }
}

vue-docgen-api seems to fail on the named export inside index.js. If I import the mixin file directly I don't get an error message.

Are you familiar with this issue? Maybe it's also a mistake on my side...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions