Storybook: Storybook 5 - Missing emotion dependencies

Created on 6 Mar 2019  路  6Comments  路  Source: storybookjs/storybook

Start storybook fail after installing storybook 5 because of missing dependencies.

*Module not found: Error: Can't resolve '@emotion/core' in '/my-package/node_modules/emotion-theming/dist'

Dependencies:
@emotion/core
@emotion/styled

Maybe @storybook/react should include these dependencies?

For now i installed the dev dependencies manually:
npm i @emotion/core@^10.0.7 -D && npm i @emotion/styled@^10.0.7 -D

question / support yarn / npm

Most helpful comment

As #5942 was closed as a duplicate of this, adding what I said there:

  • Removing yarn.lock and node_modules and reinstalling from package.json only did _not_ work
  • Adding @storybook/theming does work (hoists @emotion/core up to the top level of node_modules)

All 6 comments

I solved it by removing node_modules and package.lock.json + npm install

Also getting this error. Removing node_modules and *.lock files had no effect.

Removing the addons-options (which is deprecated) fixed it for me. Removing the lock file it's a bit of a last resort move (in my opinion)

I got the same error after upgrading to 5.0.0. Fixed it by removing node_modules and the lockfile (no addons-options dependency) but it shouldn't be necessary in my opinion.

As #5942 was closed as a duplicate of this, adding what I said there:

  • Removing yarn.lock and node_modules and reinstalling from package.json only did _not_ work
  • Adding @storybook/theming does work (hoists @emotion/core up to the top level of node_modules)

Sorry @sargant I goofed. https://github.com/storybooks/storybook/issues/5817 has more info and is also a dupe. Resolving this one also as a dupe. Thanks for your patience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpersaud picture rpersaud  路  3Comments

shilman picture shilman  路  3Comments

purplecones picture purplecones  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

tlrobinson picture tlrobinson  路  3Comments