Closed alexbjorlig closed 7 months ago
Which version of the add-on are you using? Which version of Storybook?
Happening the same. Addon version: 2.0.0-beta.1 Storybook version: 7.6.7
My main.ts looks like:
import type { StorybookConfig } from '@storybook/html-vite';
import { dirname, join } from 'path';
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('storybook-addon-fetch-mock'),
],
framework: {
name: getAbsolutePath('@storybook/html-vite'),
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
This should be fixed with the just-released v2.0.0.
Please re-open if you are still experiencing this issue. Thanks!
I get this error when I try to use the addon: