question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storybook fails for Angular 9

See original GitHub issue

Describe the bug Storybook fails on start after running npm run docs:json && start-storybook -p 6006 I found the fix to install react and react dom, but why do I need to do this as it is IONIC + Angular.

To Reproduce Steps to reproduce the behavior:

  1. Run npm run docs:json && start-storybook -p 6006
  2. Go to http://localhost:6006/
  3. Open console
  4. See error in console and blank page

Expected behavior It opens with no errors and shows storybook

Screenshots image

Code snippets

ERR! Runtime error! Check your browser console.
ERR! TypeError: Object(...) is not a function
ERR!     at Module../node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js (http://localhost:6006/vendors~main.4bad8eb2c72bab395e1f.bundle.js:1004:99)
ERR!     at __webpack_require__ (http://localhost:6006/runtime~main.99691078705b39185f99.bundle.js:80:30)
ERR!     at Module../node_modules/@emotion/core/dist/core.browser.esm.js (http://localhost:6006/vendors~main.4bad8eb2c72bab395e1f.bundle.js:710:98)
ERR!     at __webpack_require__ (http://localhost:6006/runtime~main.99691078705b39185f99.bundle.js:80:30)
ERR!     at Module../node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js (http://localhost:6006/vendors~main.4bad8eb2c72bab395e1f.bundle.js:1782:71)
ERR!     at __webpack_require__ (http://localhost:6006/runtime~main.99691078705b39185f99.bundle.js:80:30)
ERR!     at Module../node_modules/@emotion/styled/dist/styled.browser.esm.js (http://localhost:6006/vendors~main.4bad8eb2c72bab395e1f.bundle.js:1962:78)
ERR!     at __webpack_require__ (http://localhost:6006/runtime~main.99691078705b39185f99.bundle.js:80:30)
ERR!     at Object../node_modules/@storybook/theming/dist/index.js (http://localhost:6006/vendors~main.4bad8eb2c72bab395e1f.bundle.js:48737:39)
ERR!     at __webpack_require__ (http://localhost:6006/runtime~main.99691078705b39185f99.bundle.js:80:30)

System

OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz

Binaries: Node: 12.4.0 npm: 6.14.6 Browsers: Chrome: 86.0.4240.198 Edge: Spartan (44.18362.449.0) npmPackages: @storybook/addon-a11y: ^6.1.11 => 6.1.11 @storybook/addon-actions: ^6.1.10 => 6.1.11 @storybook/addon-essentials: ^6.1.10 => 6.1.11 @storybook/addon-links: ^6.1.10 => 6.1.11 @storybook/addon-notes: ^5.3.21 => 5.3.21 @storybook/addon-storysource: ^6.1.11 => 6.1.11 @storybook/angular: ^6.1.10 => 6.1.11 npmGlobalPackages: @storybook/cli: 6.1.10

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
victoriaunizhonacommented, Apr 9, 2021

I have swagger-ui@3.28.0 that ships with react@15 and it breaks storybook for me (with the same emotion-element problem). What?

For angular developers: adding

    "react": "^16.14.0",
    "react-dom": "^16.14.0"

to package.json is a workaround for this issue.

Yep, this works as I mentioned in description. But it seems redundant and increases bundle size. Would be great to have it fixed.

1reaction
nickbullockcommented, Apr 9, 2021

I have swagger-ui@3.28.0 that ships with react@15 and it breaks storybook for me (with the same emotion-element problem). What?

For angular developers: adding

    "react": "^16.14.0",
    "react-dom": "^16.14.0"

to package.json is a workaround for this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

storybook fails to start after upgrade angular - Stack Overflow
After I upgraded angular from 12 to 14 I have a problem with start storybook app. There are some problems on run:
Read more >
storybook/angular - npm
Storybook for Angular is a UI development environment for your Angular components. With it, you can visualize different states of your UI ...
Read more >
Storybook for Angular tutorial
It helps you build UI components isolated from the business logic and context of your app. This edition of the Intro to Storybook...
Read more >
Angular 15.0 | having a weird error using Storybook for ...
having a weird error using Storybook for angular components. the array im looping is legit.. it also throw that errors on other arrays...
Read more >
Storybook fails with Angular 12 and webpack5 #16367
Storybook fails with Angular 12 and webpack5 #16367 · Describe the bug After updating to angular 12 the project seems to run fine...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found