Comments (8)
when i attempt the above, i see
> yarn run storybook
yarn run v1.17.3
$ start-storybook --ci --port=9002
info @storybook/react v5.3.0-alpha.38
info
info => Loading presets
info => Loading presets
info => Loading custom addons config.
WARN A `scriptsPackageName` was provided, but couldn't be resolved.
ERR! Failed to resolve a `react-scripts` package.
info => Using default Webpack setup.
any number of ../
doesn't seem to work properly
even though my node_modules
contains react-scripts
in it
from presets.
Hi @maniax89, sorry for the slow reply.
I'm currently using Yarn workspaces with CRA and this preset and it's working as expected.
Are you using a custom scripts package? Can you provide any more information?
scriptsPackageName
should not point to a file in .bin
, but instead the package folder.
from presets.
I am not using a custom scripts package. One of the issues with a mono repo is duplicate dev dependencies throughput the repository. So instead of specifying react-scripts
in every package's package.json
, I only specify it once in the project root.
However, since my storybook build is run from one of the packages (not project root) via something like yarn workspace my-package run storybook
there's no way for me to reference the project root react-scripts
package, even if I point directly to the node_module
(sorry my example pointed at the .bin
location)
Everything works fine if I specify the react-scripts
dev dependency in the package that uses it, was just asking for an enhancement to support when we hoist those dev dependencies to the project root.
I'll see if I can produce an example repo to showcase what I'm trying to do
from presets.
@maniax89 If you're doing that, then I think that's going to be hard for us to support - as you're not using this monorepo in the expected way.
Monorepos dedupe, so this shouldn't be an issue if they're all at the same version. You can use features like Yarn's resolutions
to help here. Let me know if you want some tips on that :)
That being said, your case should be solvable regardless - have you tried this?
const path = require("path");
module.exports = [
{
name: "@storybook/preset-create-react-app",
options: {
scriptsPackageName: path.resolve("../../../node_modules/react-scripts"),
}
}
];
from presets.
Are you able to share this project @maniax89? Even privately?
Can you share your current config file here?
from presets.
Hi @maniax89, did you get this working? If so, can we close this one off? Thanks!
from presets.
Sorry - I haven't gotten back around to this since the initial discussion so I'm going to close it for now and reopen if and when I get a reproducible repo example. Thanks for checking in on this
from presets.
Related to #112
from presets.
Related Issues (20)
- [Bug] CRA does not print eslint errors to terminal anylonger
- [Bug] CRA preset does not support ES2020 dependencies HOT 2
- Where are the tests for your presets?
- V3.2.0 works but V4.0.0 does not HOT 4
- [Bug] preset-create-react-app: Storybook config dir webpack override breaks default CRA config
- [Bug] Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works HOT 5
- [Bug] CRA5, [email protected] HOT 6
- [Bug] Fails in case of using custom folder structure inside /src
- [Help] Cannot find module '@babel/plugin-proposal-private-property-in-object'
- @storybook/preset-create-react-app 4.0.1 breaks Storybook HOT 4
- [Bug]: macos - Error: Cannot find module '.../node_modules/config/webpack.config' HOT 5
- [Bug] URL from readme does not exist on the website
- [Bug] ENAMETOOLONG on "preset-create-react-app@4" package installation HOT 1
- [Bug] start-storybook breaks when tsconfig.json has comments (preset-create-react-app)
- [Bug] Package dependency HOT 4
- [Bug] Confusing error message when stories folder is outside of src.
- [Bug] cannot run storybook with CRA preset version 4.1.0. HOT 1
- @storybook/react-docgen-typescript-plugin canary dependency
- [Bug] Storybook preset function `getReactScriptsPath` has bug HOT 2
- Missing license file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presets.