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

Uncaught Error: Accessing nonexistent addons channel #72

Closed
remarcable opened this issue Mar 24, 2018 · 3 comments
Closed

Uncaught Error: Accessing nonexistent addons channel #72

remarcable opened this issue Mar 24, 2018 · 3 comments

Comments

@remarcable
Copy link

Hello there,

I'm not sure if it's a problem of this project, but at least it seems to be related.
When using storybook with this addon, everything builds normally, but an error gets thrown at runtime:

index.js:39 Uncaught Error: Accessing nonexistent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel
    at AddonStore.getChannel (index.js:39)
    at muiTheme (muiTheme.js:48)
    at Object.<anonymous> (config.js:12)
    at Object.defineProperty.value (config.js:19)
    at __webpack_require__ (bootstrap 21742c234614f94ef929:678)
    at fn (bootstrap 21742c234614f94ef929:88)
    at Object.window.STORYBOOK_REACT_CLASSES (ReactPropTypesSecret.js:12)
    at __webpack_require__ (bootstrap 21742c234614f94ef929:678)
    at bootstrap 21742c234614f94ef929:724
    at preview.bundle.js:728
getChannel @ index.js:39
muiTheme @ muiTheme.js:48
(anonymous) @ config.js:12
Object.defineProperty.value @ config.js:19
__webpack_require__ @ bootstrap 21742c234614f94ef929:678
fn @ bootstrap 21742c234614f94ef929:88
window.STORYBOOK_REACT_CLASSES @ ReactPropTypesSecret.js:12
__webpack_require__ @ bootstrap 21742c234614f94ef929:678
(anonymous) @ bootstrap 21742c234614f94ef929:724
(anonymous) @ preview.bundle.js:728

Opening muiTheme.js on line 48 reveals that it indeed accesses an addon channel.

My addons.js looks like this, nothing special:

import 'storybook-addon-material-ui';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';

and my config.js like this:

import { configure, addDecorator } from '@storybook/react';
import { muiTheme } from 'storybook-addon-material-ui';
import { theme } from '../imports/ui/components/theme';
import '../client/main.css';

const req = require.context('../imports/ui/components', true, /\.stories\.js$/);

function loadStories() {
  req.keys().forEach(filename => req(filename));
}

addDecorator(muiTheme([
  'Light Theme',
  'Dark Theme',
  theme,
]));


configure(loadStories, module);

What do you think is the problem? Even when not loading any stories this seems to happen. Thank you very much!

"storybook-addon-material-ui": "^0.8.2"
"@storybook/addons": "^3.3.15",
"@storybook/react": "^3.3.15"
@usulpro
Copy link
Member

usulpro commented Apr 11, 2018

Hi @lightningboss thanks for reporting it! I'll check it

@remarcable
Copy link
Author

Hey @usulpro, is there an update on this one?

@usulpro
Copy link
Member

usulpro commented Jun 9, 2018

@lightningboss sorry for late answer
this kind of bug happens when you have two different versions of @storybook/addons
if it's this case you can remove both and install the latest.
Nevertheless, I updated dependencies, so after updating this addon and storybook to the latest versions it should works fine

@usulpro usulpro closed this as completed Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants