CLI - create-react-library - 5.1 regression
See original GitHub issueDescribe the bug
Running storybook init (npx -p @storybook/cli@next sb init
) on a project generated with create-react-library
with next storybook version results with an error:
• Adding storybook support to your "Create React App" based project
TypeError: Cannot read property 'split' of undefined
at new Range (/home/mfolnovic/.npm/_npx/25246/lib/node_modules/@storybook/cli/node_modules/semver/semver.js:866:20)
at outside (/home/mfolnovic/.npm/_npx/25246/lib/node_modules/@storybook/cli/node_modules/semver/semver.js:1408:11)
at Function.gtr (/home/mfolnovic/.npm/_npx/25246/lib/node_modules/@storybook/cli/node_modules/semver/semver.js:1402:10)
at gtr (/home/mfolnovic/.npm/_npx/25246/lib/node_modules/@storybook/cli/generators/REACT_SCRIPTS/index.js:42:14)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
Difference between what generates create-react-app
and create-react-library
is where it puts react-scripts
dependency. create-react-app
puts it in dependencies
while create-react-library
puts it in devDependencies
.
It works if I move react-scripts
dependency from devDependencies
to dependencies
after generating project with create-react-library
.
It also works correctly with 5.0.11: npx -p @storybook/cli sb init
.
To Reproduce Steps to reproduce the behavior:
npm install -g create-react-library
create-react-library -s -t default test
cd test
npx -p @storybook/cli@next sb init
Expected behavior
It should work the same way as npx -p @storybook/cli sb init
- without an error, generating files.
System:
- OS: Linux (Arch Linux)
- Device: Thinkpad P50
- Framework: React
- Version: v5.1.0-beta.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
This seems like a simple fix, i’ll take this one for you @mrmckeb . PR incoming
Jeepers creepers!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-rc.0 containing PR #6815 that references this issue. Upgrade today to try it out!
Because it’s a pre-release you can find it on the
@next
NPM tag.Closing this issue. Please re-open if you think there’s still more to do.