vatson / rollup-plugin-vuetify

Vuetify autoloader 🤖
MIT License
20 stars 1 forks source link

Errors with vue-class-component #72

Open ascott18 opened 3 years ago

ascott18 commented 3 years ago

I'm getting an error with SFC components with vue-class-component.

Minimal repro at https://github.com/ascott18/vuetify-rollup-bug

[!] (plugin vuetify) Error: The structure of the exported component can not be recognized. Please open an issue with a usage example at https://github.com/vatson/rollup-plugin-vuetify/issues
src\components\test-component.vue?rollup-plugin-vue=script.ts
Error: The structure of the exported component can not be recognized. Please open an issue with a usage example at https://github.com/vatson/rollup-plugin-vuetify/issues
    at findExport (C:\src\vuetify-rollup-bug\node_modules\rollup-plugin-vuetify\src\transform.js:107:9)
    at findUseTarget (C:\src\vuetify-rollup-bug\node_modules\rollup-plugin-vuetify\src\transform.js:111:21)
    at module.exports (C:\src\vuetify-rollup-bug\node_modules\rollup-plugin-vuetify\src\transform.js:152:33)
    at extractAndTransform (C:\src\vuetify-rollup-bug\node_modules\rollup-plugin-vuetify\src\plugin.js:11:10)
    at Object.transform (C:\src\vuetify-rollup-bug\node_modules\rollup-plugin-vuetify\src\plugin.js:32:16)
    at ModuleLoader.addModuleSource (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18403:30)
    at ModuleLoader.fetchModule (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18459:9)
    at async Promise.all (index 0)
    at ModuleLoader.fetchStaticDependencies (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18485:34)
    at async Promise.all (index 0)
    at ModuleLoader.fetchModule (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18461:9)
    at async Promise.all (index 0)
    at ModuleLoader.fetchStaticDependencies (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18485:34)
    at async Promise.all (index 0)
    at ModuleLoader.fetchModule (C:\src\vuetify-rollup-bug\node_modules\rollup\dist\shared\rollup.js:18461:9)
    at async Promise.all (index 0)
vatson commented 3 years ago

Hey @ascott18

I'll take a look. Thank you for the report and for a thorough approach to bug filing.

ascott18 commented 2 years ago

The is caused by exporting named classes export default class Foo extends Vue { instead of anonymous classes export default class extends Vue {.

This bit of code here is the culprit. Commenting out the line name: "default_1", fixes the issue entirely. https://github.com/vatson/rollup-plugin-vuetify/blob/ef322f8fa1725f56b89d91bf4b1bdbb8182248f4/src/transform.js#L37

Judging by your profile, I'd imagine you're a little busy with the invasion of your home to deal with this. Stay safe, and thank you for your work on this package.