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
We set-up npm7 workspaces for our monorepo with a storybook installation using preset-create-react-app. The preset has troubles finding react-scripts and by default throws the error: ERR! Failed to resolve a `react-scripts` package.
I found the following workaround, which I think should be included by default:
const path = require("path");
module.exports = {
stories: ["../src/**/*.stories.@(js|ts|tsx|mdx)"],
addons: [
{
name: "@storybook/preset-create-react-app",
options: {
scriptsPackageName: path.resolve("../node_modules/react-scripts"), // add this line so react-scripts is found
},
},
"@storybook/addon-essentials",
],
};
Steps to reproduce the behavior
Monorepo set-up using npm 7 with a storybook installation as a sub package will cause this error.
Expected behavior
React-scripts should not have troubles being located by default.
Screenshots and/or logs
Environment
OS: MacOS
Node.js version: [e.g. v15.8.0]
NPM version: [e.g. 7.5.4]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
We set-up npm7 workspaces for our monorepo with a storybook installation using preset-create-react-app. The preset has troubles finding react-scripts and by default throws the error:
ERR! Failed to resolve a `react-scripts` package.
I found the following workaround, which I think should be included by default:
Steps to reproduce the behavior
Monorepo set-up using npm 7 with a storybook installation as a sub package will cause this error.
Expected behavior
React-scripts should not have troubles being located by default.
Screenshots and/or logs
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: