storybook: Storybook hooks broken in `next`

Getting this Storybook hooks-related error:

Addons___A11y___BaseButton_-_Default_⋅_Storybook

This occurred somewhere between the 6.1-alpha.32 and 6.1-alpha.33 releases.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 22 (14 by maintainers)

Most upvoted comments

If anyone can put together a reproduction that would be very helpful. If anyone does manage to track it down feel free to open an issue on the Apollo addon GitHub. I’d love to fix it, but I need more context on the problem in order to make a proper change.

@shilman this is the issue I mentioned to you earlier. It seems like there might be more than one reason for this error. One of the reasons this can happen is due to having multiple versions of Apollo installed so when the addon tries to register it uses a different version than the one expected. I generally fix this using the yarn resolutions feature in the package.json but there could be another issue in the code of the Apollo addon and I’d love to get a review from someone more knowledgeable about the storybook hooks so we could potentially uncover it.

I managed to do a bit more investigation and it seems to be some combination of the background addon and storybook-addon-apollo-client for me. If I have that addon last in the list (which their docs example shows) then I get the hooks error, but if I move it to before the essentials addon then everything works as expected.