hwookim / storybook-addon-cookie

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

`Rendered fewer hooks than expected` error with Storybook 7 #5

Open Mystilund opened 1 year ago

Mystilund commented 1 year ago

Hi,

This week I had to update the project of my company to use a new version of NX (from v15 to v16), which implied to upgrade Storybook as well (v6 to v7). We used to have the cookieDecorator in our preview file, using the version 1.0.4 of the addon, and everything was working well.

After the update, I have the version 3.0.1 of the addon and Storybook 7.0.26, and I got this error on some stories :

Capture d’écran 2023-07-12 à 10 16 35

It only occurs on 30 stories out of 250, 3 for components and most of the errors are on stories of our email views. I checked the source code of the lib, it doesn't seem there is an early return before the use of hooks so I don't know why it's happening. Also FYI, we don't even use the cookie feature anymore, so I'm gonna remove the decorator from our codebase, but it's really weird and maybe some other people can face the issue, that's why I'm opening this issue 😄

hwookim commented 1 year ago

I apologize for the delay in my response. Thank you for reporting the issue. We'll take a look at it.

Abbeyy commented 8 months ago

Hi! Any update to this issue? Latest release of v3.2.0 this still persists:) Thanks!