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
"Those who do not learn history are doomed to repeat it."
I resolved this, the same way I did before (almost): #219 (comment)
constRELATIVE_PATH_TO_ROOT='../../../';
viteFinal: async(config)=>{// This should be able to be removed pending the release of https://github.com/storybookjs/storybook/pull/17000config.resolve.alias={
...config.resolve.alias,'@emotion/react': path.resolve(path.join(__dirname,RELATIVE_PATH_TO_ROOT,'node_modules/@emotion/react')),'@emotion/styled': path.resolve(path.join(__dirname,RELATIVE_PATH_TO_ROOT,'node_modules/@emotion/styled')),'@emotion/core':path.resolve(path.join(__dirname,RELATIVE_PATH_TO_ROOT,'node_modules/@emotion/react')),'emotion-theming': path.resolve(path.join(__dirname,RELATIVE_PATH_TO_ROOT,'node_modules/@emotion/react')),}returnconfig}
Now the part I got wrong was assuming (boldly) that the resolve alias should point to the packages locations, i.e. emotion-theming to node_modules/emotion-theming but actually having these alias' set as above (mostly pointing to @emotion/react) is what makes this workaround work.
I've come across an issue with trying to use storybook in a monorepo with this builder, using emotion and trying to render docs.
The setup is:
components
packageI have created a minimum reproduction repository here: https://github.com/Codex-/monorepo-storybook-error
To see this error, pull the repository and run
npm i && npm run components:storybook
Once built, in the browser you are met with a blank content box and this error in the console:
This appears to be emitted by emotion, but this works perfectly when not in a monorepo structure. Any ideas or help is appreciated 🙏
The text was updated successfully, but these errors were encountered: