hwookim / storybook-addon-cookie

Set document.cookie for each Storybook.
MIT License
9 stars 3 forks source link

Storybook 7.x.x support #2

Closed AyronK closed 1 year ago

AyronK commented 1 year ago

Hi,

Is support for Storybook v7 planned? We use storybook-addon-cookie in our Storybook setup and we had to disable it due to incompatibility.

hwookim commented 1 year ago

@AyronK Thanks for letting me know!

We'll check it out and update as soon as possible. Can you also let me know exactly which version of storybook you are using?

AyronK commented 1 year ago

We freshly upgraded to 7.0.18.

There is an issue on Storybook addressing addon compatibility, which you might want to have a look at.

https://github.com/storybookjs/storybook/issues/20529

I will be focusing on Storybook migration in the next days, so if you have any questions, let me know, I'll try to help!

hwookim commented 1 year ago

Luckily, the migration guide for addon was kind enough to make the update painless. Thank you for reporting this.

I'll close this issue. If you have any problems, feel free to open an issue :)

AyronK commented 1 year ago

Thanks! I'll test it later this week.

AyronK commented 1 year ago

I installed version 3.0.0 of the addon, and Storybook does not crash on launch as it used to. Although, stories using the addon encounter the following error in cookieDecorator.js:16:1 on render.

uncaught TypeError: fn is not a function
    at hookified (runtime.js:7:17241)
    at runtime.js:34:1451
    at runtime.js:34:1912
    at cookieDecorator (cookieDecorator.js:16:1)
    at hookified (runtime.js:7:17241)
    at runtime.js:34:1451
    at runtime.js:34:1912
    at renderWithHooks (react-dom.development.js:16305:1)
    at mountIndeterminateComponent (react-dom.development.js:20074:1)
    at beginWork (react-dom.development.js:21587:1)
hookified @ runtime.js:7

It seems like a undefined function is passed somewhere to Storybook internals. @hwookim, do you have any idea if that could by fault of my configuration or a consequence of your addon migration?

AyronK commented 1 year ago

It seems that was a fault in my config. It works as a charm, than you for such a quick reaction @hwookim. I appreciate your support by a lot 🥇!