You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see the @storybook/addon-essentials is not added, because it throws the following ERROR:
✘ [ERROR] Could not read from file: /Users/done/Workspace/vue-ts-kitt/.yarn/__virtual__/@storybook-blocks-virtual-76de42567a/3/.yarn/berry/cache/@storybook-blocks-npm-8.0.10-6f477cd35f-10c0.zip/node_modules/@storybook/blocks/dist
../../.yarn/berry/cache/@storybook-addon-docs-npm-8.0.10-a4fac154e7-10c0.zip/node_modules/@storybook/addon-docs/dist/chunk-HLWAVYOI.mjs:3:61:
3 │ import { CodeOrSourceMdx, AnchorMdx, HeadersMdx, Docs } from '@storybook/blocks';
╵ ~~~~~~~~~~~~~~~~~~~
✘ [ERROR] Could not read from file: /Users/done/Workspace/vue-ts-kitt/.yarn/__virtual__/react-dom-virtual-c3570acd48/3/.yarn/berry/cache/react-dom-npm-18.3.1-a805663f38-10c0.zip/node_modules/react-dom/client
.yarn/__virtual__/@storybook-react-dom-shim-virtual-9fe4787d9d/3/.yarn/berry/cache/@storybook-react-dom-shim-npm-8.0.10-319d8d5c7b-10c0.zip/node_modules/@storybook/react-dom-shim/dist/react-18.mjs:2:21:
2 │ import ReactDOM from 'react-dom/client';
Please, help? What shall I do? 🤷♂️ And it's actually only the @storybook/addon-essentials plugin that doesn't work.
Unfortunately, I wasn't able to get it to work. My solution is now to downgrade to Storybook v7.6.19 and removing the MDX support (so no MDX files are included), but luckily it seems like that the autodocs are working. So, my storybook config file looks now like this:
importtype{StorybookConfig}from'@storybook/vue3-vite';import{join,dirname}from'path';import{UserConfig,PluginOption}from'vite';/** * 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. */constgetAbsolutePath=(value: string): string=>{returndirname(require.resolve(join(value,'package.json')));};constconfig: StorybookConfig={stories: ['../src/components/**/*.stories.ts'],addons: [getAbsolutePath('@storybook/addon-links'),getAbsolutePath('@storybook/addon-essentials'),getAbsolutePath('@storybook/addon-interactions')],framework: {name: '@storybook/vue3-vite',options: {}},docs: {autodocs: 'tag'},viteFinal: (config: UserConfig)=>{/** * Remove the vite-plugin-dts to prevent * that Storybook creates TS types. Otherwise * the dts plugin runs twice with two different * configurations in the GitHub CI/CD pipeline. */config.plugins=(config.pluginsasPluginOption[])?.filter((plugin: PluginOption)=>(pluginasany)?.name!=='vite:dts');returnconfig;}};exportdefaultconfig;
While starting Storybook I get the following warnings from Vite.
8:18:34 AM [vite] warning: rewrote @storybook/global to .yarn/cache/sb-vite-plugin-externals/@storybook/global.js but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.
Plugin: alias
8:18:34 AM [vite] warning: rewrote @storybook/preview-api to .yarn/cache/sb-vite-plugin-externals/@storybook/preview-api.js but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.
Plugin: alias
8:18:34 AM [vite] warning: rewrote @storybook/core-events to .yarn/cache/sb-vite-plugin-externals/@storybook/core-events.js but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.
Plugin: alias
8:18:34 AM [vite] warning: rewrote @storybook/client-logger to .yarn/cache/sb-vite-plugin-externals/@storybook/client-logger.js but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.
Plugin: alias
8:18:34 AM [vite] warning: rewrote @storybook/channels to .yarn/cache/sb-vite-plugin-externals/@storybook/channels.js but was not an abolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.
Plugin: alias
The text was updated successfully, but these errors were encountered:
dark-kitt
changed the title
[Bug]: Yarn PnP with Storybook 8 => @storybook/addon-essentials not work
[Bug]: Yarn 4 PnP with Storybook 8 => @storybook/addon-essentials not work
May 11, 2024
After the release of v8.1.0 I tried it again and found also my mistake. The problem was that Storybook included my Vite configuration which was not compatible with the Storybook setup. So, it ended up that I had just to add some resolve.extensions to the Vite configuration.
.storybook/main.ts
It seems like it is not necessary anymore to resolve the absolute path of a package. I have no errors. 🤷♂️
importtype{StorybookConfig}from'@storybook/vue3-vite';import{UserConfig,PluginOption}from'vite';constconfig: StorybookConfig={stories: ['../src/introductions/**/*.mdx','../src/components/**/*.stories.ts'],addons: ['@storybook/addon-links','@storybook/addon-essentials','@storybook/addon-interactions','@chromatic-com/storybook'],framework: {name: '@storybook/vue3-vite'},viteFinal: (config: UserConfig)=>{/** * Remove the vite-plugin-dts to prevent * that Storybook creates TS types. Otherwise * the dts plugin runs twice with two different * configurations in the GitHub CI/CD pipeline. */config.plugins=(config.pluginsasPluginOption[])?.filter((plugin: PluginOption)=>(pluginasany)?.name!=='vite:dts');returnconfig;}};exportdefaultconfig;
Describe the bug
I recently started to add Storybook 8 and run in the following issue.
As you can see the
@storybook/addon-essentials
is not added, because it throws the following ERROR:Please, help? What shall I do? 🤷♂️ And it's actually only the
@storybook/addon-essentials
plugin that doesn't work.To Reproduce
I'm trying to add Storybook 8 here: https://github.com/dark-kitt/vue-ts-kitt
System
Additional context
Called with
yarn storybook
and custom cache dir, but the custom cache dir isn't the issue.After some troubleshooting
Unfortunately, I wasn't able to get it to work. My solution is now to downgrade to Storybook v7.6.19 and removing the MDX support (so no MDX files are included), but luckily it seems like that the
autodocs
are working. So, my storybook config file looks now like this:While starting Storybook I get the following warnings from Vite.
The text was updated successfully, but these errors were encountered: