Skip to content

Rendered fewer hooks than expected error with Storybook 7 #5

@Mystilund

Description

@Mystilund

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 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions