hipstersmoothie / storybook-dark-mode

A storybook addon that lets your users toggle between dark and light mode.
MIT License
435 stars 56 forks source link

Bug: color function error on Chrome #137

Closed MildTomato closed 3 years ago

MildTomato commented 3 years ago

Possible issue with running storybook with storybook-dark-mode on Chrome

Screenshot 2021-02-03 at 13 55 29
ERR! Runtime error! Check your browser console.
ERR! Error: Passed an incorrect argument to a color function, please pass a string representation of a color.
ERR! 
ERR! 
ERR!     at parseToRgb (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103486:11)
ERR!     at opacify (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:104393:21)
ERR!     at fn (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103920:42)
ERR!     at convert (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34671:42)
ERR!     at ensure (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34795:31)
ERR!     at http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:44103:36
ERR!     at renderWithHooks (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:131778:18)
ERR!     at mountIndeterminateComponent (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:134457:13)
ERR!     at beginWork (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:135571:16)
ERR!     at HTMLUnknownElement.callCallback (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:117163:14)
ERR! Runtime error! Check your browser console.
ERR! Error: Passed an incorrect argument to a color function, please pass a string representation of a color.
ERR! 
ERR! 
ERR!     at parseToRgb (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103486:11)
ERR!     at opacify (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:104393:21)
ERR!     at fn (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103920:42)
ERR!     at convert (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34671:42)
ERR!     at ensure (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34795:31)
ERR!     at http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:44103:36
ERR!     at renderWithHooks (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:131778:18)
ERR!     at mountIndeterminateComponent (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:134457:13)
ERR!     at beginWork (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:135571:16)
ERR!     at HTMLUnknownElement.callCallback (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:117163:14)
ERR! Runtime error! Check your browser console.
ERR! Error: Passed an incorrect argument to a color function, please pass a string representation of a color.
ERR! 
ERR! 
ERR!     at parseToRgb (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103486:11)
ERR!     at opacify (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:104393:21)
ERR!     at fn (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:103920:42)
ERR!     at convert (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34671:42)
ERR!     at ensure (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:34795:31)
ERR!     at http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:44103:36
ERR!     at renderWithHooks (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:131778:18)
ERR!     at mountIndeterminateComponent (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:134457:13)
ERR!     at beginWork (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:135571:16)
ERR!     at HTMLUnknownElement.callCallback (http://localhost:6006/vendors~main.61bf1f5d8d2c9de00ced.bundle.js:117163:14)

Browser Console Screenshot 2021-02-03 at 14 01 07

Chrome : Version 88.0.4324.96 (Official Build) (x86_64) OS: OSX 11.1 (20C69) "@storybook/core": "6.1.11",

Anyone else experience this?

hipstersmoothie commented 3 years ago

Would you mind taking a stab at this? If not could you provide a reproduction repo?

MildTomato commented 3 years ago

The error seemed to have disappeared, I did clean npm installs. I'll reopen it and try and investigate if it happens again 😄