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 not loading - Uncaught undefined

See original GitHub issue

Current Behavior

Running the nx run storybook:<project> command successfully builds and deploys Storybook, but when navigating to http://localhost:4400 it only displays a blank page and throws some errors in the console (see below).

Expected Behavior

Storybook should should start without errors.

Steps to Reproduce

I have created a reproduction here: https://github.com/klingebiel/nx-storybook-issue You can run npm run storybook and navigate to http://localhost:4400 to reproduce the issue.

I set up the workspace with the following steps:

  • Create empty workspace with create-nx-workspace
  • Add Angular application
  • Add Angular library
  • Add Storybook configuration for library

Failure Logs

vendors-node_modules_storybook_addon-actions_dist_esm_register_js-node_modules_storybook_addo-f09f2b.manager.bundle.js
> Uncaught undefined
> The above error occurred in one of your React components:
    in Unknown (created by Scroller)
    in Suspense (created by Scroller)
    in Scroller (created by Context.Consumer)
    in Styled(Scroller)
    in Unknown (created by Context.Consumer)
    in Bar (created by FlexBar)
    in FlexBar (created by Tabs)
    in div (created by Context.Consumer)
    in Styled(div) (created by Tabs)
    in Tabs
    in Tabs (created by AddonPanel)
    in AddonPanel
    in Unknown (created by ManagerConsumer)
    in ManagerConsumer (created by Panel)
    in Panel (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Panel)
    in Panel (created by Layout)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in div (created by Context.Consumer)
    in Styled(div) (created by Main)
    in Main (created by Layout)
    in Layout (created by Context.Consumer)
    in WithTheme(Layout) (created by DesktopLayout)
    in DesktopLayout (created by App)
    in div (created by Context.Consumer)
    in Styled(div) (created by App)
    in App
    in App (created by SizeMeRenderer(Component))
    in SizeMeReferenceWrapper (created by SizeMeRenderer(Component))
    in SizeMeRenderer(Component) (created by SizeMe(Component))
    in SizeMe(Component)
    in ThemeProvider
    in Unknown (created by ManagerConsumer)
    in ManagerConsumer (created by Manager)
    in EffectOnMount (created by Manager)
    in Manager (created by QueryLocation)
    in QueryLocation (created by Main)
    in Main (created by Root)
    in Router (created by BrowserRouter)
    in BrowserRouter (created by Root)
    in HelmetProvider (created by Root)
    in Root

Environment

  Node : 16.13.1
  OS   : linux x64
  npm  : 8.1.2
  
  nx : 13.3.0
  @nrwl/angular : 13.3.0
  @nrwl/cli : 13.3.0
  @nrwl/cypress : 13.3.0
  @nrwl/devkit : 13.3.0
  @nrwl/eslint-plugin-nx : 13.3.0
  @nrwl/express : undefined
  @nrwl/jest : 13.3.0
  @nrwl/linter : 13.3.0
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : undefined
  @nrwl/nx-cloud : undefined
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.0
  @nrwl/web : undefined
  @nrwl/workspace : 13.3.0
  @nrwl/storybook : 13.3.0
  @nrwl/gatsby : undefined
  typescript : 4.4.4
  rxjs : 7.4.0
  ---------------------------------------
  Community plugins:
         @angular/animations: 13.1.0
         @angular/common: 13.1.0
         @angular/compiler: 13.1.0
         @angular/core: 13.1.0
         @angular/forms: 13.1.0
         @angular/platform-browser: 13.1.0
         @angular/platform-browser-dynamic: 13.1.0
         @angular/router: 13.1.0
         @angular-devkit/build-angular: 13.0.4
         @angular/cli: 13.0.4
         @angular/compiler-cli: 13.1.0
         @angular/language-service: 13.1.0
         @storybook/angular: 6.4.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:44 (21 by maintainers)

github_iconTop GitHub Comments

5reactions
electrofLycommented, Dec 16, 2021

@mandarini as strange as this looks after adding those 2 dependencies my issue si resolved:

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

The react library was not installed but react-dom was installed. As my investigation went @nrwl/workspace installs react@17.0.2 while the dependency for storybook is react@16.14.0.

3reactions
mandarinicommented, Dec 16, 2021

Looking into this ppl! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to troubleshoot storybook not loading stories?
Resave save the story file. It makes the component reappear in side panel, and then you can see the errors ...
Read more >
Frequently Asked Questions - Storybook - JS.ORG
Why are my stories not showing up correctly when using certain characters? ... Why is Storybook's source loader returning undefined with curried functions?...
Read more >
Troubleshooting - Material UI - MUI
This document covers known issues and common problems encountered when migrating from ... If your project uses Storybook v6.x, you will need to...
Read more >
storybook cannot read properties of undefined ... - You.com
The TypeError: Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the default export object ......
Read more >
I m not being able to run storybook on my project - Reddit
I m not being able to run storybook on my project ... Uncaught undefined :6006/runtime-error:1 Failed to load resource: the server responded ...
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