Storybook: Peer dependency warning for Storybook Angular.

Created on 25 Nov 2018  路  19Comments  路  Source: storybookjs/storybook

Describe the bug
Why do I get these warnings on Yarn install. I am trying to use storybook for angular app.

warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning "@storybook/addon-actions > @emotion/[email protected]" has unmet peer dependency "react@>=16.3.0".
warning "@storybook/addon-actions > @emotion/[email protected]" has unmet peer dependency "react@>=16.3.0".
warning "@storybook/addon-actions > @storybook/[email protected]" has unmet peer dependency "react@*".
warning "@storybook/addon-actions > @storybook/[email protected]" has unmet peer dependency "react-dom@*".
warning "@storybook/addon-actions > [email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@storybook/addon-actions > @emotion/styled > @emotion/[email protected]" has unmet peer dependency "react@>=16.3.0".
warning "@storybook/addon-actions > @storybook/components > [email protected]" has unmet peer dependency "react@>=0.14.0 <17.0.0".
warning "@storybook/addon-actions > @storybook/components > [email protected]" has unmet peer dependency "react@^15.0.0 || ^16.0.0".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning "@storybook/addon-storyshots > [email protected]" has unmet peer dependency "jest@*".
warning " > @storybook/[email protected]" has unmet peer dependency "react@*".
warning "@storybook/addon-storysource > [email protected]" has unmet peer dependency "react@>= 0.14.0".

Do I need to provide react libs in my package.json?

angular good first issue question / support

Most helpful comment

@Roen00 no need to worry about these issues. At some point we'll need to do a refactor to address this, but it's low on our priorities.

All 19 comments

You shouldn't need to. Recent versions of @storybook/angular depends on react@^16.6.0 and react-dom@^16.6.0, so it should just work. What version of Storybook are you using? And can you upgrade to the latest stable release if you're not already on it?

@shilman I am still seeing this with v4.0.8. I am using Yarn.

Technically it will work since react is installed with storybook anyway. But since there is no thing like the transitive peer deps you will see these warnings untill you won't add react to your dev deps.

Yes. It does work. But the warnings are annoying. Adding a dev dependency on react in an Angular based repository could raise eyebrows as well.

What's your recommendation? Keep the warnings or add react to dev dependency?

I think you can keep warnings for now.

After https://github.com/storybooks/storybook/releases/tag/v4.1.0-alpha.4 we can just hide react dep in all the addons that are bundled to the manager. We need to make sure that the React in manager is our React though 馃 Maybe with aliasing. CC: @ndelangen @shilman

Thanks @igor-dv Let's fix this soon. I would be happy to contribute if you like.

@codeNoobie , I would very like you to contribute =) also you can hang with us on Discord.

@igor-dv Thanks. Let's discuss this change soon. Please also move this issue to open state.

Sure.

@igor-dv For addons, what if we replace peer dependency on react with optional dependency on react? We can put some fallback code in the manager to fail/ignore gracefully?

https://docs.npmjs.com/files/package.json#optionaldependencies

The problem is that optional deps are like real deps, but when there is a problem with installing it, it won't fail the whole installation... I am not sure this fits the react pkg in our case...

@codeNoobie , do you need help with this?

Is it safe now to remove these peer dependencies?

I'm having the same issue with Ember
Screenshot 2019-12-20 at 11 30 55

What's the status this issue? Should we worry about these warnings?

@Roen00 no need to worry about these issues. At some point we'll need to do a refactor to address this, but it's low on our priorities.

I get an equally large bunch of warnings on React/CRA.

image

@codeNoobie Are you still working on this? :)

For me the same with the latest version:

image

Any updates on this?

There is a workaround to suppress this huge bunch of warnings? I'm working with Angular, in an NX workspace.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomitrescak picture tomitrescak  路  3Comments

sakulstra picture sakulstra  路  3Comments

purplecones picture purplecones  路  3Comments

tirli picture tirli  路  3Comments

rpersaud picture rpersaud  路  3Comments