diff --git a/src/index.ts b/src/index.ts index d26a4a2..67824d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ import { combineParameters } from "@storybook/client-api"; +import addons, { mockChannel } from '@storybook/addons'; import type { Story, Meta, StoryContext } from "@storybook/vue3"; import type { StoryFnVueReturnType, ContextedStory, GlobalConfig, StoriesWithPartialProps } from "./types"; @@ -6,6 +7,9 @@ import decorateStory from "./decorateStory"; let globalStorybookConfig: GlobalConfig = {}; +// Some addons use the channel api to communicate between manager/preview, and this is a client only feature, therefore we must mock it. +addons.setChannel(mockChannel()); + export function setGlobalConfig(config: GlobalConfig) { globalStorybookConfig = config; }