Cannot parse an SFC that has mixed exports
See original GitHub issueCurrent behavior
When you try to parse an SFC that has default export and named export, the library throws an error below.
vue-docgen-api: multiple exports in a component file are not handled by docgen.parse, Please use "docgen.parseMulti" instead
The same error happened when you use parseMulti function.
To reproduce
Code Sandbox: https://codesandbox.io/s/vue-docgen-api-mixed-export-w2xj3
Expected behavior
Parses the file correctly, or throws an appropriate error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Props table is broken when using more exports in file (vue)
It was that vue-docgen-api cannot parse mixed exports in SFC, as @Aaron-Pool said. I filed an issue on docgen-api repo ...
Read more >Typescript Vue class-based components throwing error ...
I'm using Laravel Mix to compile my Vue components and for it, I used TypeScript and class-based components. Every single class is exported...
Read more >@vue/compiler-sfc | Yarn - Package Manager
Just use the main vue/compiler-sfc deep import instead. This package contains lower level utilities that you can use if you are writing a...
Read more >How We Refreshed Our Vue 2 JavaScript Codebase ... - Medium
How we created and maintain a TypeScript / JavaScript hybrid Vue.js codebase for a smooth and progressive transition.
Read more >sf.pdf
x an object of class sf, sfc or sfg that has mixed geometry (GEOMETRY or GEOMETRYCOLLECTION). type character; one of "POLYGON", "POINT", " ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@elevatebart I believe it should be for the default export.
Let’s say for example I have a radio component which has multiple display types inside an object. In order to make a more dynamic test or extend storybook knobs, I export the object in order to use it in other places as well as within the component.
@elevatebart Thanks for taking a look at this! I tried 4.5.2 which includes the fix for this issue and confirmed it parse SFCs without throwing an error.
But it would be better to not include the named-exported object in the result: just ignoring named-exports is enough since in most cases they are not components, IMO. What do you think?
Also, I noticed the
docgen.parsemethod returns a named-exported object (maybe a first exported object?) instead of default exported component. (Sandbox)