Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook 6.0 React version 16.x not the same as tsdx create React version 17.x #916

Closed
ghost opened this issue Oct 28, 2020 · 2 comments
Closed
Labels
kind: bug Something isn't working scope: dependencies Pull requests that update a dependency file scope: templates Related to an init template, not necessarily to core (but could influence core) scope: upstream Issue in upstream dependency solution: outdated This is not up-to-date with the current version

Comments

@ghost
Copy link

ghost commented Oct 28, 2020

Current Behavior

When I run npx tsdx create mylib --template react-with-storybook I get this error:

Error: Command failed with exit code 1: npm install @babel/core @size-limit/preset-small-lib @storybook/addon-essentials @storybook/addon-info @storybook/addon-links @storybook/addons @storybook/react @types/react @types/react-dom babel-loader husky react react-dom react-is size-limit tsdx tslib typescript --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mylib@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   dev react@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @storybook/addon-essentials@6.0.27
npm ERR! node_modules/@storybook/addon-essentials
npm ERR!   dev @storybook/addon-essentials@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Simon\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Simon\AppData\Local\npm-cache\_logs\2020-10-28T18_43_43_980Z-debug.log

    at makeError (C:\Users\Simon\AppData\Local\npm-cache\_npx\99d8f6679c19e750\node_modules\execa\lib\error.js:59:11)
    at handlePromise (C:\Users\Simon\AppData\Local\npm-cache\_npx\99d8f6679c19e750\node_modules\execa\index.js:114:26)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async C:\Users\Simon\AppData\Local\npm-cache\_npx\99d8f6679c19e750\node_modules\tsdx\dist\index.js:173:9

npm ERR! code 1
npm ERR! path C:\Users\Simon\Projects
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c ""tsdx" "create" "mylib" "--template" "react-with-storybook""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Simon\AppData\Local\npm-cache\_logs\2020-10-28T18_43_44_014Z-debug.log

Expected behavior

The project should be created without errors.

Suggested solution(s)

Upgrade storybook version to a version that uses react@17.0.1 (if it exists) or downgrade react to react@16.8.0.

Additional context

Your environment

  System:
    OS: Windows 10 10.0.19041
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 22.72 GB / 31.93 GB
  Binaries:
    Node: 15.0.1 - D:\Program Files\nodejs\node.EXE
    npm: 7.0.3 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.423.0), Chromium (86.0.622.56)
    Internet Explorer: 11.0.19041.1
@agilgur5 agilgur5 added scope: upstream Issue in upstream dependency kind: bug Something isn't working scope: templates Related to an init template, not necessarily to core (but could influence core) labels Oct 29, 2020
@agilgur5
Copy link
Collaborator

Thanks for the bug report. Looks like React 17 just got out of RC last week. This a bug upstream as Storybook is working on React 17 support and has an alpha release of v6.1.0 that seems to support it (but is missing react-dom support).

I have a feeling this will be released shortly, so I'm not sure if action is warranted. But yes, create doesn't pin any specific version which means it always has latest without needing to change the code but which can also cause problems like this (or #810 ) where latest of one thing isn't compatible with everything else.

As you're probably aware, this can be manually fixed by manually downgrading in the meantime, so it shouldn't be a huge hindrance. I noticed you were using npm v7 which does have some different behavior regarding peerDeps, so that might complicate it a bit.

@agilgur5 agilgur5 added the scope: dependencies Pull requests that update a dependency file label Oct 31, 2020
@agilgur5 agilgur5 changed the title Storybook React version not the same as TSDX React version Storybook 6.0 React version 16.x not the same as tsdx create React version 17.x Oct 31, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Dec 24, 2020

Storybook 6.1.0 was released into stable on November 18th and supports React 17, so this is no longer an issue. Please upgrade your Storybook version if this still. affects you.

@agilgur5 agilgur5 added the solution: outdated This is not up-to-date with the current version label Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working scope: dependencies Pull requests that update a dependency file scope: templates Related to an init template, not necessarily to core (but could influence core) scope: upstream Issue in upstream dependency solution: outdated This is not up-to-date with the current version
Projects
None yet
Development

No branches or pull requests

1 participant