-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Comments
Having the same issue here :( |
@rej156 do you have a repo to reproduce the issue? I am trying with the latest RC and can't reproduce it. |
Same issue here - could it be related to storybook-addon-styled-component-theme - are you using it @iamdriz ? |
Same issue here.
|
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 :( |
I am suddenly seeing this after updating to the new |
@sami616 upgrading from what version? |
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:
Is enough to make it fall over. An example 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. |
@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 |
I managed to fix the issue by installing storybook theming
|
@shilman - tried adding
|
@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):
|
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:
|
If anybody has a public repro of this, I'd love to take a look! |
Ehy, news about that ? i have the same issue updating from 5.0 to 5.2.4 |
@thecreazy nope, still borked. Are you using styled components by any chance? Or storybook-addon-styled-component-theme ? |
@shilman I'm trying to figure out if I'm allowed to stick a 5.2.* branch on a public repo for you :) |
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 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 |
What happens if you remove all the bits to do with the exelerotech theme? @thecreazy |
Nothing, same error if i pass a standard light theme or if i don't use the |
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 Packages
ConfigNote: I've removed all of the
Displayed ErrorCannot read property 'lightest' of undefined
Console Error
|
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
Config
|
@seanmhanson what happens when you run If you find that there are multiple copies installed, try installing Just a hunch.... |
@shilman good hunch! That wound up being the trick, and I'm pretty certain it was something dup'd or stale involving my |
Storybook would throw an error caused by a dependency mismatch. storybookjs/storybook#7914
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! |
@storybook/theming |
Storybook would throw an error caused by a dependency mismatch. storybookjs/storybook#7914
Storybook would throw an error caused by a dependency mismatch. storybookjs/storybook#7914
I'm still getting this error in the 5.3.12 |
@Iuriy-Budnikov I can take a look at your issue, if you give me a repro repo. |
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 😬 |
@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. |
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. |
Hey @ndelangen , |
FIX: wearepush/push-ui#31 Storybook 6 will feature a big change, no longer sharing babel config between manager & preview. |
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 ✨ |
This same issue had occurred for us yesterday after updating our I found out, that for some reason we had two Posting this here, because maybe it will help someone. |
Just for better clarification for those still struggling with this, these seem to be the 3 packages that By just installing the latest of each, deleting your package-lock / yarn-lock file, and then re-running |
@premm In general, all |
@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 |
Hi @honorsuper , |
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
Yields the following
and fixes the bug from this issue. |
@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: storybook/lib/theming/package.json Lines 31 to 32 in ff99e99
Lines 31 to 32 in ff99e99
|
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.
|
@ludan1107743896 can you give us some more info on your environment? |
I'm running into this same problem, with the following added quirks:
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.
All Storybook packages are the same version as well:
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 I'd love to have some guidance on what I'm doing wrong here before I spend too much more time with this. |
Just in case anyone is having the same issues as mentioned above or getting this error I can confirm that a complete nuke of storybook and a fresh re-install using |
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:
Any ideas what the problem could be or where I could start looking to see the issue?
The packages used are as follows:
The
config.js
file is as follows:The text was updated successfully, but these errors were encountered: