-
Notifications
You must be signed in to change notification settings - Fork 2
Addons depend on module state, deduplication required (Cannot read property 'removeListener' of null) #8
Comments
Hi @Ezku, thanks for reporting. We'll look into it ASAP. |
This is pretty weird since Anyway, are you using any linked NPM repos for storybook? |
@arunoda This does happen with npm version 2 because it installs two copies. Just checked. Do we need to support npm v2? |
Yep. It seems like we need that webpack alias in storybook. Could you try using that? |
Thanks for your attention on the issue. I can confirm that I'm on npm 2.x, @roonyh. |
Published a new |
I'm closing this now. But, feel free to reopen if needed. |
Hello,
I was setting up
storybook-addon-knobs
for a project and had quite a bit of trouble getting it running. The communication channel setup was failing, breaking the decorated component that should have been rendered with the story with the following trace:Tracing the problem and finding a solution, I found out the following:
storybook-addon-knobs
requires the channel instorybook-addons
to be set https://github.com/kadirahq/storybook-addons/blob/master/dist/index.js#L17storybook
https://github.com/kadirahq/react-storybook/blob/master/dist/client/preview/index.js#L71After some debugging I confirmed that
storybook
andstorybook-addon-knobs
each received their own instance ofstorybook-addons
. Thus, the former would set the channel on one instance and the latter would assume it to be there, only to run across a null.Given this problem, the solution was to deduplicate
storybook-addons
. The simplest way to do that I found from webpack/webpack#1165, adding a resolution alias to webpack:Is this expected behavior or a bug?
Thanks for the effort on this tool, it's been very helpful once I arrived at a functioning configuration.
Annex
My
addons.js
(copy paste from the documentation):The failing story:
The text was updated successfully, but these errors were encountered: