Closed kyrstenkelly closed 3 years ago
Could you get a reproduction repo together? thanks!
Yep! Here we go. This repo shows the error for me: https://github.com/kyrstenkelly/storybook-dark-mode-example
May be worth noting that I'm on:
Were you running this before without issue? I think what's happening is you updated storybook to a new version and this plugin is caching an old version of the theme leading to a broken storybook.
Could you try opening storybook in a private window?
:rocket: Issue was released in v1.0.5
:rocket:
Hi! I'm experiencing a bug when I try to use this addon. Here's what I'm seeing in both the browser console and my terminal.
Uncaught Error: Passed an incorrect argument to a color function, please pass a string representation of a color.
Here are my relevant files.
Our custom theme file -
.storybook/customTheme.js
Using our custom theme -
.storybook/manager.js
I installed the addon:
npm install -D storybook-dark-mode
and it installed:"storybook-dark-mode": "^1.0.4"
and added the addon to my
.storybook/main.js
:and that's when I get the error.
I have also tried adding configuration in my
.storybook/preview.js
file like so, but I still get the error:I tried many variations of setting the
darkMode
configuration in the parameters. I tried extending our own theme instead ofthemes
from storybook/theming, and many other things.Am I doing something wrong? I feel like I'm following the steps in the documentation accurately. I'd love some assistance, thank you.