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

React Native: Null channel with addon-options #815

Closed
shilman opened this issue Apr 15, 2017 · 16 comments
Closed

React Native: Null channel with addon-options #815

shilman opened this issue Apr 15, 2017 · 16 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 15, 2017

Issue by inyono
Tuesday Mar 28, 2017 at 16:02 GMT
Originally opened as storybook-eol/storybook-addon-options#15


I'm failing to get this to work with React Native (and create-react-native-app). After following the README, I get the error null is not an object (evaluating 'channel.emit') @ setOptions.

storybook/addons.js

import '@kadira/react-native-storybook/addons';
import '@kadira/storybook-addon-options/register';

storybook/index.js

import './addons';

import { NativeModules } from 'react-native';
import { getStorybookUI, configure } from '@kadira/react-native-storybook';
import url from 'url';

import { setOptions } from '@kadira/storybook-addon-options';

setOptions({
    name: 'CUSTOM-OPTIONS',
    url: 'https://github.com/kadirahq/storybook-addon-options',
    goFullScreen: false,
    showLeftPanel: false,
    showDownPanel: false,
    showSearchBox: false,
    downPanelInRight: false,
    sortStoriesByKind: false,
});

configure(
  () => {
    require('./stories');
  },
  module
);

const { hostname } = url.parse(NativeModules.SourceCode.scriptURL);

export default getStorybookUI({ port: 19001, host: hostname });

Any idea, what the problem might be?

@simply-innovative
Copy link

@shilman @mthuret : I am also running into the same problem, can you please help us on this. Based on README it is supported on rn storybook, not sure why we ending up with this error.

plz let us know in case you have any updates

@inyono
Copy link

inyono commented May 24, 2017

Funny, I'm currently testing out Storybook 3 Alpha and run into this problem again ^^. Although, according to https://github.com/storybooks/storybook/tree/v3.0.0-alpha.5/addons/options it should work with React Native. So yeah, still a problem with @storybook/addon-options at version 3.0.0-alpha.0.

@shilman
Copy link
Member Author

shilman commented May 24, 2017

@inyono Thanks so much for testing this out! Your help is much appreciated (and great Medium post too!). If you're able to figure something out here, a PR would be much appreciated. 🥇 👍 ❤️

NOTE, the latest NPM-published version is alpha.4 not alpha.5. it's a little confusing and i'm currently trying to rectify that 😉

@prscX
Copy link

prscX commented Jun 1, 2017

we are also running into the same issue, any help would be very much appreciated

Stack:

  • Storybook 3
  • RN 0.45.0.rc-2

@shilman
Copy link
Member Author

shilman commented Jun 1, 2017

@inyono @pranavrajsinghchauhan Can you check to see if there are two instances of the addon-options package somewhere underneath your node_modules directory?

@inyono
Copy link

inyono commented Jun 2, 2017

@shilman Doesn't seem like it:

> find node_modules -type d -name 'addon-options'
node_modules/@storybook/addon-options

Reproducible example: https://github.com/serlo-org/serlo-abc/tree/addon-options

@shilman
Copy link
Member Author

shilman commented Jun 3, 2017

@inyono 👍 for the repro! I will check it out and let you know what I find. (cc @tmeasday )

@tmeasday
Copy link
Member

tmeasday commented Jun 5, 2017

Hi @inyono! Thanks for the reproduction. How do I run it? I tried npm start or running storybook, but it seems to not quite work correctly (I don't see any errors anyway).

@tmeasday
Copy link
Member

tmeasday commented Jun 5, 2017

@shilman does @storybook/react-native not depend on addons?:

screenshot 2017-06-05 12 09 30

@tmeasday
Copy link
Member

tmeasday commented Jun 5, 2017

Hmm, maybe you can't trust npm list then: https://github.com/storybooks/storybook/blob/master/app/react-native/package.json#L39

Sigh
screenshot 2017-06-05 12 14 12

[One might ask what the point of npm list is]

@tmeasday
Copy link
Member

tmeasday commented Jun 5, 2017

Alright, the issue wasn't anything to do with node_modules, that was a bit of a furphy.

@tmeasday
Copy link
Member

tmeasday commented Jun 5, 2017

Ok, this issue is more succinctly explained by #1192. @inyono the best current workaround is a setTimeout, as far as we can tell.

I'm going to make a better error message for the options addon until we resolve the underlying issue (#1191).

@ndelangen
Copy link
Member

@tmeasday Do we need to keep this issue open then?

@tmeasday
Copy link
Member

I guess not. It might be useful to have the issue open for people searching for it?

@shilman shilman changed the title Usage with React Native React Native: Null channel with addon-options Jul 11, 2017
@ndelangen
Copy link
Member

#1514

@tmeasday
Copy link
Member

And #1515

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

8 participants