Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'lightest' of undefined #7914

Closed
iamdriz opened this issue Aug 29, 2019 · 53 comments
Closed

TypeError: Cannot read property 'lightest' of undefined #7914

iamdriz opened this issue Aug 29, 2019 · 53 comments

Comments

@iamdriz
Copy link

iamdriz commented Aug 29, 2019

I have installed Storybook Docs as per the documentation here: https://github.com/storybookjs/storybook/blob/next/addons/docs/README.md#installation

And I have used the Manual preset configuration.

When I view the Docs tab for any of my stories I get the following error:

TypeError: Cannot read property 'lightest' of undefined
    at getScrollAreaStyles (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:11822:78)
    at http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:41276:100
    at updateContextConsumer (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:92999:19)
    at beginWork (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:93187:14)
    at performUnitOfWork (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:96827:12)
    at workLoop (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:96867:24)
    at renderRoot (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:96950:7)
    at performWorkOnRoot (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:97857:7)
    at performWork (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:97769:7)
    at performSyncWork (http://localhost:6006/vendors~main.e02af6e0f1f31fb510a2.bundle.js:97743:3)

Any ideas what the problem could be or where I could start looking to see the issue?

The packages used are as follows:

    "@babel/core": "^7.4.5",
    "@storybook/addon-docs": "^5.2.0-beta.46",
    "@storybook/addon-knobs": "^5.2.0-beta.46",
    "@storybook/addon-notes": "^5.2.0-beta.46",
    "@storybook/html": "^5.2.0-beta.46",
    "babel-loader": "^8.0.6",
    "webpack": "^4.39.3"

The config.js file is as follows:

import { addParameters, configure } from '@storybook/html';
import { themes } from '@storybook/theming';
import yourTheme from './yourTheme';
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks';

// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.(js|mdx)$/);
function loadStories() {
  req.keys().forEach(filename => req(filename));
}

// Option defaults:
addParameters({
  docs: {
    container: DocsContainer,
    page: DocsPage
  },
  options: {
    /**
     * show story component as full screen
     * @type {Boolean}
     */
    isFullscreen: false,
    /**
     * display panel that shows a list of stories
     * @type {Boolean}
     */
    showNav: true,
    /**
     * display panel that shows addon configurations
     * @type {Boolean}
     */
    showPanel: true,
    /**
     * where to show the addon panel
     * @type {('bottom'|'right')}
     */
    panelPosition: 'bottom',
    /**
     * sorts stories
     * @type {Boolean}
     */
    sortStoriesByKind: false,
    /**
     * regex for finding the hierarchy separator
     * @example:
     *   null - turn off hierarchy
     *   /\// - split by `/`
     *   /\./ - split by `.`
     *   /\/|\./ - split by `/` or `.`
     * @type {Regex}
     */
    hierarchySeparator: /\/|\./,
    /**
     * regex for finding the hierarchy root separator
     * @example:
     *   null - turn off multiple hierarchy roots
     *   /\|/ - split by `|`
     * @type {Regex}
     */
    hierarchyRootSeparator: /\|/,
    /**
     * sidebar tree animations
     * @type {Boolean}
     */
    sidebarAnimations: true,
    /**
     * enable/disable shortcuts
     * @type {Boolean}
     */
    enableShortcuts: false,
    /**
     * show/hide tool bar
     * @type {Boolean}
     */
    isToolshown: true,
    /**
     * theme storybook, see link below
     */
    theme: themes.light
  }
});

// must come last
configure(loadStories, module);
@ericjuta
Copy link

ericjuta commented Sep 2, 2019

Having the same issue here :(

@atanasster
Copy link
Member

@rej156 do you have a repo to reproduce the issue? I am trying with the latest RC and can't reproduce it.

@pierrenel
Copy link

Same issue here - could it be related to storybook-addon-styled-component-theme - are you using it @iamdriz ?

@MarianSulgan
Copy link

MarianSulgan commented Oct 3, 2019

Same issue here.
@pierrenel I am not using mentioned addon and still get the error, so must be related to something else...
Adding list of addons I have - worked without problems on 5.1.9.

@storybook/addon-actions/register
@storybook/addon-links/register
@storybook/addon-backgrounds/register
@storybook/addon-viewport/register
@storybook/addon-a11y/register

@pierrenel
Copy link

I tried 5.2.1 and still having the same issue - the getScrollAreaStyles code references a property on a theme which it doesn't have access to for some reason :(

@sami616
Copy link

sami616 commented Oct 4, 2019

I am suddenly seeing this after updating to the new alpha.9 release. Only when clicking on the Docs tab oddly.

@shilman
Copy link
Member

shilman commented Oct 7, 2019

@sami616 upgrading from what version?

@SimonS
Copy link

SimonS commented Oct 8, 2019

I don't know what's causing this, but we had the same issue. I pared it down to markdown looking like this (that's double-indented text):

Screenshot 2019-10-08 14 25 57

Converting it to a simple bullet list makes that error go away.

@SimonS
Copy link

SimonS commented Oct 9, 2019

Further investigation seems to point it to anything involving code blocks. Our use case was that we changed a bunch of README.md files to .mdx files and imported them with the hopes that some super-literate component readmes could sit beside our components in storybook, so something like:

### Example

```jsx
import React from 'react';
...

Is enough to make it fall over.

An example .stories.jsx file might look like:

import mdx from './README.mdx';

export default {
  title: '...',
  component: Paragraph,
  parameters: {
    docs: {
      page: mdx
    }
  }
};

I add the extra detail, cos there's a chance we might be abusing stories/trying to use them for something they're not intended to, so please tell us if this is a fool's errand :)

I need to find some time to look deeper, but having a click around the DocsPages code and the getScrollAreasStyle - it looks like when the MDX interpreter hits a code block, it is passing it to a scroll area, which is expecting that theme parameter to be passed to it, and then borking out. I imagine it's a wiring problem, but lack the time and expertise right now to get my head in it.

@sami616
Copy link

sami616 commented Oct 9, 2019

@SimonS i can confirm that removing the code block from my mdx file has worked, so seems to be the culprit. I'm also using the docs: { page } parameter

@ArnoZx
Copy link

ArnoZx commented Oct 10, 2019

I managed to fix the issue by installing storybook theming

"@storybook/theming": "^5.2.3",

@shilman
Copy link
Member

shilman commented Oct 10, 2019

@SimonS @sami616 can you try @ArnoZx 's workaround and lmk if it works for you?

@pierrenel
Copy link

@shilman - tried adding "@storybook/theming": "^5.2.3", and still getting:

TypeError: Cannot read property 'lightest' of undefined
    at getScrollAreaStyles (http://localhost:6006/vendors~main.29b4625e4d045c010817.bundle.js:16817:78)

@SimonS
Copy link

SimonS commented Oct 10, 2019

@shilman - cheers, I'm getting a slightly different error, but seems to be in the same area (tried both updating just theming to 5.2.3 and all storybook dependencies):

theme.color is undefined

getScrollAreaStyles@http://localhost:6006/vendors~main.660c17218fffa9c4bfcf.bundle.js:27130:7
../../../node_modules/@storybook/theming/node_modules/@emotion/core/dist/core.browser.esm.js/Global

@SimonS
Copy link

SimonS commented Oct 14, 2019

I dunno if it's helpful for anyone else getting this error, for now we're working around this by sending in our own component. It loses the syntax highlighting, however:

parameters: {
  docs: {
    page: mdx,
    components: { code: ({ children }) => <code>{children}</code> }
  }
}

@shilman
Copy link
Member

shilman commented Oct 14, 2019

If anybody has a public repro of this, I'd love to take a look!

@thecreazy
Copy link

thecreazy commented Oct 17, 2019

Ehy, news about that ?

i have the same issue updating from 5.0 to 5.2.4

@pierrenel
Copy link

@thecreazy nope, still borked. Are you using styled components by any chance? Or storybook-addon-styled-component-theme ?

@pierrenel
Copy link

@shilman I'm trying to figure out if I'm allowed to stick a 5.2.* branch on a public repo for you :)

@thecreazy
Copy link

thecreazy commented Oct 17, 2019

thx @pierrenel nope i'm using this packages:

  "@storybook/addon-a11y": "^5.2.4",
  "@storybook/addon-actions": "^5.2.4",
  "@storybook/addon-options": "^5.2.4",
  "@storybook/addon-storysource": "^5.2.4",
  "@storybook/addon-viewport": "^5.2.4",
  "@storybook/react": "^5.2.4",

and this is my config.js

import {
  addDecorator,
  addParameters,
  configure
} from '@storybook/react';
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks';


import {
  withA11y
} from '@storybook/addon-a11y';

import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';


import exeleroLight from './theme.js';

import '@exelerotech/fringe-style/src/style/index.scss';


addParameters({
  viewport: {
    viewports: INITIAL_VIEWPORTS,
  },
  options: {
    theme: exeleroLight,
  },
  docs: {
    container: DocsContainer,
    page: DocsPage
  },
});

addDecorator(withA11y);


function requireAll(requireContext) {
  return requireContext.keys().map(requireContext);
}

function loadStories() {
  require('./generalStories/colors.jsx');
  require('./generalStories/typography.jsx');
  requireAll(require.context('../src/components', true, /index.stories\.(jsx|mdx)?$/));
}



configure(loadStories, module);

Unfortunately i'm not working on a public repo but if you need more information you can write directly to me

@pierrenel
Copy link

pierrenel commented Oct 17, 2019

What happens if you remove all the bits to do with the exelerotech theme? @thecreazy

@thecreazy
Copy link

Nothing, same error if i pass a standard light theme or if i don't use the options.theme props @pierrenel

@seanmhanson
Copy link

I'm running into this too after upgrading us to 5.2.4 and starting to move us away from storiesOf and toward CSFs. This happens for all stories (both CSF and storiesOf based stories, none are yet using MDX), and only when clicking the Docs tab. Here's all the debugging info I could gather for y'all, unfortunately the repo is private.

Note: I have not yet tried installing "@storybook/theming" as a possible work-around, but will return here to update if that changes anything.

Packages

"@storybook/addon-actions": "5.2.4",
"@storybook/addon-docs": "5.2.4",
"@storybook/addon-info": "5.2.4",
"@storybook/addon-links": "5.2.4",
"@storybook/react": "5.2.4",

Config

Note: I've removed all of the addDecorator calls and stripped this just down to the req and configure call, and the error remains the same.

const React = require('react');
const { configure, addDecorator } = require('@storybook/react');
const { withInfo } = require('@storybook/addon-info');

addDecorator(
  withInfo({
    inline: true,
    header: true,
    source: false,
  })
);

addDecorator(story => <div style={{ width: '95%', margin: '0 auto' }}>{story()}</div>);

const req = require.context('./', true, /\.story\.(js|ts|tsx|mdx)$/);
configure(req, module);

Displayed Error

Cannot read property 'lightest' of undefined

TypeError: Cannot read property 'lightest' of undefined
    at getScrollAreaStyles (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:17810:78)
    at http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:35180:100
    at updateContextConsumer (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:189627:19)
    at beginWork (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:189815:14)
    at performUnitOfWork (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:193455:12)
    at workLoop (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:193495:24)
    at renderRoot (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:193578:7)
    at performWorkOnRoot (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:194485:7)
    at performWork (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:194397:7)
    at performSyncWork (http://localhost:9001/vendors~main.446c0681352a8017e829.bundle.js:194371:3)

Console Error

ScrollAreaStyles.js:120 Uncaught TypeError: Cannot read property 'lightest' of undefined
    at getScrollAreaStyles (ScrollAreaStyles.js:120)
    at core.browser.esm.js:174
    at updateContextConsumer (react-dom.development.js:15484)
    at beginWork (react-dom.development.js:15672)
    at performUnitOfWork (react-dom.development.js:19312)
    at workLoop (react-dom.development.js:19352)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at replayUnitOfWork (react-dom.development.js:18578)

The above error occurred in the <Context.Consumer> component:
    in ForwardRef(render)
    in ScrollArea
    in Unknown (created by Context.Consumer)
    in Bar (created by FlexBar)
    in div (created by FlexBar)
    in FlexBar
    in Unknown (created by Context.Consumer)
    in Styled(Component) (created by Toolbar)
    in Toolbar (created by Preview)
    in div (created by Context.Consumer)
    in Styled(div) (created by Preview)
    in div (created by Context.Consumer)
    in Styled(div) (created by Preview)
    in Preview (created by Context.Consumer)
    in Preview (created by DocsStory)
    in div (created by Anchor)
    in Anchor (created by DocsStory)
    in DocsStory (created by Context.Consumer)
    in DocsPage (created by Context.Consumer)
    in DocsPage
    in div (created by Context.Consumer)
    in Styled(div) (created by DocsContainer)
    in div (created by Context.Consumer)
    in Styled(div) (created by DocsContainer)
    in MDXProvider (created by DocsContainer)
    in ThemeProvider (created by DocsContainer)
    in DocsContainer

@seanmhanson
Copy link

The work-around of installing the theming and using a dark theme didn't work for me. For the record here were the changes that I made:

Packages

"@storybook/theming": "5.2.4"

Config

import { (...), addParameters } from '@storybook/react';

(...)

addParameters({
  options: {
    theme: themes.dark,
  },
});

(...)

@shilman
Copy link
Member

shilman commented Oct 17, 2019

@seanmhanson what happens when you run yarn list @storybook/theming (or whatever the npm equivalent is) or yarn list @emotion/core. i suspect that there's some package that should be a singleton, that's actually installed multiple times in your project due to some yarn/npm weirdness.

If you find that there are multiple copies installed, try installing @storybook/theming, clearing your lockfile, and re-generating.

Just a hunch....

@seanmhanson
Copy link

@shilman good hunch! That wound up being the trick, and I'm pretty certain it was something dup'd or stale involving my package-lock.json. Thanks for the help.

connor-baer added a commit to sumup-oss/circuit-ui that referenced this issue Nov 10, 2019
Storybook would throw an error caused by a dependency mismatch.
storybookjs/storybook#7914
@stale
Copy link

stale bot commented Nov 18, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Nov 18, 2019
@winssps
Copy link

winssps commented Dec 5, 2019

@storybook/theming
@emotion/core
@emotion/styled

@stale stale bot removed the inactive label Dec 5, 2019
connor-baer added a commit to sumup-oss/circuit-ui that referenced this issue Dec 11, 2019
Storybook would throw an error caused by a dependency mismatch.
storybookjs/storybook#7914
connor-baer added a commit to sumup-oss/circuit-ui that referenced this issue Dec 11, 2019
Storybook would throw an error caused by a dependency mismatch.
storybookjs/storybook#7914
@Iuriy-Budnikov
Copy link

I'm still getting this error in the 5.3.12

@Iuriy-Budnikov
Copy link

Screenshot 2020-02-07 at 11 16 05

@ndelangen
Copy link
Member

@Iuriy-Budnikov I can take a look at your issue, if you give me a repro repo.

@pierrenel
Copy link

Yep, still getting it too - I had to set up a patch to change ScrollAreaStyles.js so it doesn't refer to theme.color.darkest / theme.color.lightest. Something was invoking this file without passing in the theme properly 😬

@shilman
Copy link
Member

shilman commented Feb 10, 2020

@pierrenel @Iuriy-Budnikov 99% sure this is the symptom of a version mismatch / yarn issue. I'm not sure what's the best way to diagnose/fix, but I've seen and fixed this in dozens of different storybooks.

@ndelangen
Copy link
Member

Yeah standard practice of "removing lockfiles & node_modules and re-install" fixes this 99.99% of the time.

There's nothing we can really to to prevent this, I think.

@Iuriy-Budnikov
Copy link

Hey @ndelangen ,
here my repo and storybook

@ndelangen
Copy link
Member

FIX: wearepush/push-ui#31

Storybook 6 will feature a big change, no longer sharing babel config between manager & preview.

@pierrenel
Copy link

thanks @shilman - I ended up ripping all the storybook related packages out of my package.json, and ran sb init from scratch and slowly re-added each storybook addon. It's working perfectly now ✨

@VladimirPittner
Copy link

This same issue had occurred for us yesterday after updating our yarn.lock (without updating storybook).
Removing yarn.lock, node_modules did not helped.

I found out, that for some reason we had two @emotion/core in yarn.lock.
We use emotionJS in our project aswell, the version in our package.json was 10.0.27. (I remember I already had to bump the version once to .27 when moving to SB 5.3).
Bumping the version of @emotion/core in our package.json to 10.0.28 helped to have just one @emotion/core in yarn.lock.

Posting this here, because maybe it will help someone.

@mr-matt-b
Copy link

mr-matt-b commented Mar 20, 2020

@storybook/theming
@emotion/core
@emotion/styled

Just for better clarification for those still struggling with this, these seem to be the 3 packages that
each need to have the same version throughout your package-lock / yarn-lock.

By just installing the latest of each, deleting your package-lock / yarn-lock file, and then re-running npm i / yarn, it should fix your issue.

@shilman
Copy link
Member

shilman commented Mar 21, 2020

@premm In general, all @storybook/* packages from the Storybook monorepo should have the same version and we recommend in multiple places that people upgrade them simultaneously.

@honorsuper
Copy link

@Iuriy-Budnikov I have the same problem with you ,have you solve it ,i have found you github project push-ui, great project, i should learn form it

@Iuriy-Budnikov
Copy link

Hi @honorsuper ,
Yes, I resolved it. Try to remove package-lock/yarn lock files.
It should help

@bwhitty
Copy link

bwhitty commented Apr 8, 2020

To build on #7914 (comment), may I suggest this is a bug (or at least documentation gap?) in the way Emotion is depended upon in Storybook? I don't see any documentation stating that you must install it yourself, but for instance, having the following dependencies

    "@storybook/addon-actions": "^5.3.18",
    "@storybook/addon-info": "^5.3.18",
    "@storybook/addon-knobs": "^5.3.18",
    "@storybook/addon-viewport": "^5.3.18",
    "@storybook/react": "^5.3.18",
    "@storybook/theming": "^5.3.18",

Yields the following UNMET PEER DEPENDENCY error:

npm ls @emotion/core
├─┬ @storybook/[email protected]
│ └─┬ [email protected]
│   └── @emotion/[email protected]
├─┬ @storybook/[email protected]
│ └─┬ @storybook/[email protected]
│   └─┬ @storybook/[email protected]
│     └── UNMET PEER DEPENDENCY @emotion/[email protected]
└─┬ @storybook/[email protected]
  └── UNMET PEER DEPENDENCY @emotion/[email protected]

npm ERR! peer dep missing: @emotion/core@^10.0.27, required by [email protected]
npm ERR! peer dep missing: @emotion/core@^10.0.27, required by @emotion/[email protected]
npm ERR! peer dep missing: @emotion/core@^10.0.27, required by [email protected]

npm install --save-dev @emotion/core@^10.0.27 alleviates the problem:

npm ls @emotion/core
├── @emotion/[email protected]
├─┬ @storybook/[email protected]
│ └─┬ [email protected]
│   └── @emotion/[email protected]  deduped
├─┬ @storybook/[email protected]
│ └─┬ @storybook/[email protected]
│   └─┬ @storybook/[email protected]
│     └── @emotion/[email protected]
└─┬ @storybook/[email protected]
  └── @emotion/[email protected]

and fixes the bug from this issue.

@ndelangen
Copy link
Member

@bwhitty looks to me like you likely have a lockfile that is forcing multiple version of emotion.

Storybook packages that use emotion depend on it. We do not have peerDependencies on emotion:

"@emotion/core": "^10.0.20",
"@emotion/is-prop-valid": "^0.8.6",

"@emotion/core": "^10.0.20",
"@storybook/addons": "6.0.0-alpha.31",

@ludan1107743896
Copy link

When I view the Docs tab for any of my stories I get the following error? When I view the Docs tab for any of my stories I get the following error.

Cannot read property 'lightest' of undefined,
TypeError: Cannot read property 'lightest' of undefined
    at getScrollAreaStyles (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:21928:78)
    at http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:12656:100
    at updateContextConsumer (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:162572:19)
    at beginWork (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:162929:14)
    at HTMLUnknownElement.callCallback (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:144456:14)
    at Object.invokeGuardedCallbackDev (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:144505:16)
    at invokeGuardedCallback (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:144560:31)
    at beginWork$1 (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:167471:7)
    at performUnitOfWork (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:166425:12)
    at workLoopSync (http://localhost:9009/vendors~main.02fb8fc8078fab4170f7.bundle.js:166398:22)

@ndelangen
Copy link
Member

@ludan1107743896 can you give us some more info on your environment?

@mike-lawson
Copy link

mike-lawson commented May 18, 2020

I'm running into this same problem, with the following added quirks:

  • @emotion/core has been updated to 10.0.28
  • @emotion/styled is still on 10.0.27

I've installed each package manually to the exact same 10.0.27 version, and there doesn't appear to be any mismatch between versions, nor are there multiple versions that I'm seeing.

> npm ls @emotion/core
├── @emotion/[email protected] 
├─┬ @storybook/[email protected]
│ └─┬ @storybook/[email protected]
│   └── @emotion/[email protected]  deduped
├─┬ @storybook/[email protected]
│ └─┬ [email protected]
│   └── @emotion/[email protected]  deduped
└─┬ @storybook/[email protected]
  └── @emotion/[email protected]  deduped

> npm ls @emotion/styled
├── @emotion/[email protected] 
└─┬ @storybook/[email protected]
  └─┬ @storybook/[email protected]
    └── @emotion/[email protected]  deduped

All Storybook packages are the same version as well:

...
    "@storybook/addon-actions": "^5.3.18",
    "@storybook/addon-knobs": "^5.3.18",
    "@storybook/addon-ondevice-actions": "^5.3.18",
    "@storybook/addon-ondevice-knobs": "^5.3.18",
    "@storybook/addons": "^5.3.18",
    "@storybook/react-native": "^5.3.18",
...

Still, I'm getting the same error. Looking deeper into it, and I believe that it's an issue caused by @storybook/react-native in the sense that when this error occurs, the value of theme has the same value that is in react-native/src/preview/components/Shared/theme.ts.

I'd love to have some guidance on what I'm doing wrong here before I spend too much more time with this.

@dtaylorbrown
Copy link

dtaylorbrown commented Dec 8, 2020

Just in case anyone is having the same issues as mentioned above or getting this error Cannot read property 'theme.color' of undefined after a recent upgrade to storybook 6.1.10 using npx sb upgrade

I can confirm that a complete nuke of storybook and a fresh re-install using npx sb init did it for me. I think some old dependencies were hanging around and causing some interferance 🤷‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests