5.0.0-rc4 - cannot read property 'secondary' of undefined

See original GitHub issue

Describe the bug In 5.0.0-rc4, the storybook UI fails to load, throwing cannot read property 'secondary' of undefined, while trying to read theme.color.secondary in node_modules/@storybook/ui/dist/components/layout/draggers.js. The provided theme object is empty. I’m seeing this even if I wipe out my custom webpack config and use the default storybook config, with no addons. If I downgrade to rc3, the problem goes away.

Screenshots

image

System:

  • OS: MacOS 10.14.1
  • Device: Macbook Pro 2016
  • Browser: chrome & safari
  • Framework: react
  • Addons: None
  • Version: Storybook 5.0.0-rc4 (but not 5.0.0-rc3), with React 16.8.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:44 (26 by maintainers)

github_iconTop GitHub Comments

7reactions
jdelStrothercommented, Feb 21, 2019

Ahh, gotcha. FWIW, I can work around the issue by adding an explicit dependency for @storybook/theming in my package.json

6reactions
erikthedevelopercommented, Mar 5, 2019

For anyone running into the EntryModuleNotFoundError (I landed here while Googling / troubleshooting) I want to point out that it sounds like this is specific to yarn and that @jdelStrother’s recommendation fixed it for me:

Ahh, gotcha. FWIW, I can work around the issue by adding an explicit dependency for @storybook/theming in my package.json

📝 I’m also not using any custom theming. I did try blowing away node_modules and even yarn.lock. Still had the same issue with 5.0.0. yarn add -D @storybook/theming did the trick.

FWIW here is my entire diff (minus lock file) for upgrading a project from 4.x -> 5.0.0 just now. Thank you to all who were involved in this effort! Seriously great work 😃

diff --git a/package.json b/package.json
index 0c5553602..316257f68 100644
--- a/package.json
+++ b/package.json
@@ -58,11 +58,12 @@
     "@babel/preset-env": "7.3.4",
     "@babel/preset-react": "7.0.0",
     "@babel/register": "7.0.0",
-    "@storybook/addon-actions": "4.1.13",
-    "@storybook/addon-knobs": "4.1.13",
-    "@storybook/addon-links": "4.1.13",
-    "@storybook/addons": "4.1.13",
-    "@storybook/react": "4.1.13",
+    "@storybook/addon-actions": "5.0.0",
+    "@storybook/addon-knobs": "5.0.0",
+    "@storybook/addon-links": "5.0.0",
+    "@storybook/addons": "5.0.0",
+    "@storybook/react": "5.0.0",
+    "@storybook/theming": "5.0.0",
     "babel-eslint": "10.0.1",
     "babel-loader": "8.0.5",
     "babel-plugin-syntax-async-functions": "6.13.0",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest: Cannot read property 'secondary' of undefined - after MUI ...
We upgraded MUI from v4 to v5 and we have UI tests which started failing. Error is: TypeError: Cannot read property 'secondary' of...
Read more >
Error: Cannot read property "0" from undefined,Detail
Hello Guys , I have created on flow action . whenever I run it first time it is throwing error" Error: Cannot read...
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
Read more >
Cannot read properties of undefined (reading 'type') - MongoDB
I am getting an error similar to TypeError: Cannot read properties of undefined (reading 'startsWith') with a different variable but same ...
Read more >
Cannot read property 'timeStarted' of undefined - Bugs - Drone
Hello, I tried to connect Drone:2.0.1 to GITEA and everything worked fine. I then connected the same instance to GITHUB (changed git ...
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