Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help to debug "Accessing nonexistent addons channel" error that appears with 3.2.10 #1892

Closed
mthuret opened this issue Sep 25, 2017 · 21 comments
Assignees
Milestone

Comments

@mthuret
Copy link
Member

mthuret commented Sep 25, 2017

Hi there,

We use storybook along argos-ci to perform some visual regression testing. Since the release of 3.2.10, our build break with this error: Accessing nonexistent addons channel.

I have a hard time understanding what is the change causing this. We were using 3.2.6 for the addons lib and the warning was already here.

Here is the code that glue storybook with argos: https://github.com/algolia/react-instantsearch/blob/master/test/regressions/tests.js

I read some stuff about mocking the channel like storyshots does, I tried to mimic it but without any luck.

Does someone has any ideas?

@ndelangen
Copy link
Member

ndelangen commented Sep 25, 2017

Hey @mthuret,

Please check if all the addons you're using are updated and are using the same version of @storybook/addons.


A quick fix should be:

  • Remove node_modules
  • Remove yarn.lock if exists
  • Remove package-lock.json if exists
  • Run yarn or npm install

@gvaldambrini
Copy link
Contributor

@ndelangen I'm having the same issue. Not sure if it is related to this problem but in my case (the storybook-router development) the addon versions within the example app (cra-kitchen-sink) and within my addon are the same. What surprised me is that if I use the storybook-router version from npm (instead of the linked one) everything works fine. I can of course provide the code if it might help.

@mthuret
Copy link
Member Author

mthuret commented Sep 26, 2017

@ndelangen yes that was it because we're using renovate for updating our deps. I group the update and everyting is now fine. I'm closing this.

@gvaldambrini feel free to reopen this one or a new one if you have more details on your issue.

@mthuret mthuret closed this as completed Sep 26, 2017
stevescavo added a commit to MadeInHaus/react-starter that referenced this issue Oct 1, 2017
If the various storybook dependencies are different versions, it can cause strange issues like this one: storybookjs/storybook#1892
@StipJey
Copy link

StipJey commented Oct 3, 2017

I have this problem after update @ storybook/addon-knobs and all another @storybook/* to 3.1.12

@jcreamer898
Copy link

The only 3 addons I'm using are these, and I'm getting the same error...

@colinswilliams
Copy link

Had this happening for me too, all dependencies were at 3.2.13, so I looked into the each dependency and saw that they were relying on @storybook/addons, which wasn't a part of my package.json. So for me, doing an npm install -D @storybook/addons resolved the issue.

@ndelangen
Copy link
Member

@colinswilliams That should not be necessary to add as a dependency.. If you remove it now, it should continue to work.

If you have this problem, first thing to try is to remove node_modules and re-install. I my experience this solves the problem 99% of the time.

@colinswilliams
Copy link

@ndelangen, when I was troubleshooting, that was my first guess.

This issue was only happening on npm run build-storybook, but not through just npm run storybook.
We have CI setup to delete node_modules and do a clean npm install, and it was happening there, so in me trying to replicate it, I had it reproducing on trying to build too (so we're other devs) and still, the only thing that has resolved the issue is to define the version of addons in our package.json

@ndelangen
Copy link
Member

@colinswilliams Are you using a lockfile?

@colinswilliams
Copy link

Ooph! Good call, forgot about. Wound up deleting node_modules, and deleted the package.lock, removed @storybook/addons from package.json, and it worked. I'm assuming that when we added knobs later in the project, the lockfile referenced different versions of addons, giving us the error.

@ndelangen
Copy link
Member

The joy of lockfiles ey? 😒

I'm happy this resolved the problem.

@TroySchmidt
Copy link

TroySchmidt commented Nov 10, 2017

Did something happen with v3.2.15? I tried deleting package-lock.json, deleting node_modules, and installing @storybook/addons and nothing is getting rid of this danged non existent channels error when I am using withKnobs.

@orlowang
Copy link

orlowang commented Nov 11, 2017

@TroySchmidt I have the same problem. now I fix it by reinstall @storybook/react. it update all blow dependencies
screen shot 2017-11-11 at 2 04 33 pm
(it's looks like we should keep @storybook/channels&@storybook/channel-postmessage with same version)

@webholics
Copy link

I have the same issue currently

@petekp
Copy link
Contributor

petekp commented Nov 13, 2017

Ran into this as well after upgrading storybook and various addons to 3.2.15. Removing node_modules and package-lock.json, then re-running npm install worked for me.

@gscottolson
Copy link

I just fought with this same issue for the past few hours. Luckily, I had success with @petekp’s solution.

@Hypnosphi Hypnosphi reopened this Nov 17, 2017
@Hypnosphi Hypnosphi added this to the v3.3.0 milestone Nov 17, 2017
@Hypnosphi Hypnosphi self-assigned this Nov 17, 2017
@Hypnosphi
Copy link
Member

See #1981 (comment)

@TroySchmidt
Copy link

Played with deleting files, reinstalling, etc and made the local version work. But the CI build with VSTS using a custom agent that builds with fresh versions of the files using npm.cmd it results in no add-ons panel every time.

@ndelangen
Copy link
Member

@TroySchmidt I'm real sorry you're experiencing these issues, We're working hard resolving the issue, but it's a non-trivial problem to solve.

@Hypnosphi has proposed a solution that involves moving the dependency of the @storybook/addons package to a peerDependency.

@TroySchmidt
Copy link

TroySchmidt commented Nov 27, 2017

@Hypnosphi @ndelangen update on using alpha.4 it is back to building locally with the panels showing. But now I am getting a undefined error in KnobManager when it is trying to _this.channel.emit('addon:knobs:setKnobs',...

The actions panel is working properly.

CI build still no panels show up but interestingly enough the same error for Knobs is showing up there.

@ghost
Copy link

ghost commented Oct 10, 2018

if still you facing the same issue , try this showAddonPanel: false, in config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests