diff --git a/app/vue/src/client/preview/index.ts b/app/vue/src/client/preview/index.ts index 814c6217177..f00ff833860 100644 --- a/app/vue/src/client/preview/index.ts +++ b/app/vue/src/client/preview/index.ts @@ -17,13 +17,18 @@ import { extractProps } from './util'; export const WRAPS = 'STORYBOOK_WRAPS'; -function prepare(rawStory: StoryFnVueReturnType, innerStory?: VueConstructor): VueConstructor { +function prepare( + rawStory: StoryFnVueReturnType, + innerStory?: VueConstructor +): VueConstructor | null { let story: ComponentOptions | VueConstructor; if (typeof rawStory === 'string') { story = { template: rawStory }; - } else { + } else if (rawStory != null) { story = rawStory as ComponentOptions; + } else { + return null; } // @ts-ignore