-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Still getting "accessing nonexistent addons channel" #1981
Comments
BTW, I'm using npm |
@jcreamer898 can you try removing your lock file and |
Ahhh, I had removed |
What do we do if removing package lock or yarn lock is not an option? |
You can do the following:
|
Hi @jcreamer898 ! Im glad that you found out how to solve your issue. I'm sitting with the exact same thing when trying to use the addon "knobs". Could you describe your solution in more details, please? Did you just remove package-lock and then wrote npm install? Where did you find the package-lock file, I have 24 files with that name... |
Very strange problem with versions mismatch. What the real problem behind this? Why addons cannot be written in a way where patch (!!!) version doesn't matter? |
@storybooks/team I think we really need to make |
If that helps! I think sadly the way npm is designed it is very hard to avoid this problem :/ I think the best solution is probably to figure out a way where addons do not need to depend on the addon package (i.e the API is passed to them by the user rather than them importing it). Perhaps a small improvement we could make is to make the addons package complain if it is installed more than once? |
That's an idea worth considering for #1209 |
I am testing with 3.3.0.alpha.3 and getting the non-existent channels message. I am using TypeScript and there is no addons channel at all. This behavior now is consistent across CI, locally, run, and build output. function action(name) {
// eslint-disable-next-line no-unused-vars, func-names
var handler = function handler() {
for (var _len = arguments.length, _args = Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
var args = (0, _from2.default)(_args).map(function (arg) {
return (0, _stringify2.default)((0, _util.decycle)(arg));
});
var channel = _addons2.default.getChannel();
var id = (0, _v2.default)();
channel.emit(_.EVENT_ID, {
id: id,
data: { name: name, args: args }
});
}; If I debug in Chrome while running the line |
@TroySchmidt First of all, thank you so much for giving the 3.3 alpha a go! 🙇 Second: sorry to hear it's not been a happy road, we will fix the problem! |
It's also worth noting that you will also get this error if you haven't yet |
We have a setup using react-native that looks like this: index.js
We have no addons in the addons.js file, and every time we make a change running our app normally (so that hotreloading occurs), i.e. Config.RUN_STORYBOOK === '0', we get We've managed to get around this by doing:
So that the storyboard import does not cause this issue. Is there a better way of initialising storybook so that importing it doesn't have the above effect? I realise this issue is closed but it does seem related |
In case anyone still experiences this with the latest current version, |
when i try to solve it I added it now I removed it but not works |
Do you have a lock file? |
yes I have. When I make any change I delete it and make npm i from new |
🤔 any public repo where we can reproduce the problem? |
Two minutes will be ready |
I don't see any storybook related code there |
That's not how you should use addons and Storybook in particular. |
Wait, so I'm confused: Has the addons as peerDependency issue been solved? We've been continuously been getting bitten by this issue, especially since we have a policy of pinning our dependencies (installed addons @ 3.3.14, but 3.3.15 exists, so yarn installs 3.3.14 to node_modules and 3.3.15 to storybooks/react/node_modules). Looking in @storybooks/react, it's still listing it as a dependency -- if you expect the user to only have one copy, it should be a peerDependency where the user installs it on their side (a la react and react-dom). |
@SEAPUNK Your You don't need to install addons yourself in your |
That's the thing we have to change in 4.0 |
@danielduan That's magical, relies wholly on the hoisting system, and I don't like it. I strongly believe it should be the other way around. I'll wait until 4.0, I guess. And we do explicitly use the dependency in some of our code, e.g. registering a custom addon |
I'm having this problem as well. In my case, I have my Storybook addon which depends (using To reproduce the problem, clone the repository, switch branch to |
Try inspecting your dependency tree with
|
The problem is that in my case it is correct (as far as I understand) that both the package and the example have |
I think we should enforce channel being a singleton using some global variable like |
Fix released as |
For those who still get this issue in 3.4.x , I just figured out that I use babel module resolver. ...
"plugins": [
["module-resolver", {
"root": ["src/app", ".storybook"],
}]
]
... Then I decided to move ...
"env": {
"storybook": {
"plugins":[
["module-resolver",{
"root": [".storybook"],
}]
]
},
},
"plugins": [
["module-resolver", {
"root": ["src/app"],
}]
]
}
... It's obvious but, just in case, verify if you don't load any storyboard files when you run your app Hope this can help. |
- Re-enable the call to `setOptions` in the storybook config - Recreate the lockfile from scratch - Results from: storybookjs/storybook#1981 Looks like storybook was having some issues with peer dependencies and specific patch versions of packages having issues with each other
- Re-enable the call to `setOptions` in the storybook config - Recreate the lockfile from scratch - Results from: storybookjs/storybook#1981 Looks like storybook was having some issues with peer dependencies and specific patch versions of packages having issues with each other
if still you are facing the issue try this showAddonPanel: false, in config.js |
Fixed by Removing |
Even after bumping all my addons to the new version I'm still getting the non-existent addons error...
Something I found a bit interesting is how NPM installed things.
It's like
@storybook/react
has it's own version of addons?The text was updated successfully, but these errors were encountered: