Skip to content

Commit

Permalink
fix(svelte3): Class constructors cannot be invoked without 'new'
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Aug 23, 2022
1 parent 29ac9a1 commit fc10cd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/histoire-app/src/app/components/panel/StoryDocs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export function useStoryDoc (story: Ref<Story>) {
} else if (comp.__asyncLoader) {
comp = await comp.__asyncLoader()
} else if (typeof comp === 'function') {
comp = await comp()
try {
comp = await comp()
} catch (e) {
// Noop
// Could be a class that requires `new com()`
}
}
if (comp?.default) {
comp = comp.default
Expand Down

0 comments on commit fc10cd8

Please sign in to comment.