vue-docgen-api: failed to parsed when exported component use "as" with typescript
See original GitHub issueCurrent behavior We have exported components this way (for better typing extended components with composition api)
import { defineComponent } from '@vue/composition-api'
import CeHeader from './CeHeader'
const CeHeaderTheme = defineComponent({
extends: CeHeader
})
export default CeHeaderTheme as typeof CeHeader
But this way of exporting causes warnings in storybook:
[vue-docgen-loader] failed to parse the component file with docgen-api: No suitable component definition found on...
To reproduce
Just export some component as default and add some as typeof operator:
export default {
name: 'Test'
} as {
name: string
}
Expected behavior
I would like to use “as” operator without any warnings.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
vue-docgen-api: failed to parsed when exported component ...
On how it works: Use babel to parse the code; Find where the exports are in the file; Determine if each export is...
Read more >vue-docgen-api: failed to parsed when exported component ...
Current behavior We have exported components this way (for better typing extended components with composition api) import { defineComponent } from ...
Read more >vue-docgen-api - Vue Styleguidist
vue -docgen-api turns VueJs components into documentation objects. ... Same as parse , but allows for multiple exported components in one file.
Read more >vue-docgen-api - npm
Start using vue-docgen-api in your project by running `npm i ... than one component exported by a file, which make parse throw an...
Read more >Vue: Module parse failed when using "export * as" in TypeScript
I have an index.ts file to export all of my helpers functions. To import them in a ...
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

@shilman I love open source cooperation like this. It works like a charm.
@elevatebart I saw your changes in your repository, I have tested it with my current code base and it works great. I have crated PR to storybook to bump your package in this repository. Thank you for your time ❤️