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

Module AppRegistry is not a registered callable module #56

Open
otusweb opened this issue Feb 2, 2018 · 5 comments
Open

Module AppRegistry is not a registered callable module #56

otusweb opened this issue Feb 2, 2018 · 5 comments

Comments

@otusweb
Copy link

otusweb commented Feb 2, 2018

I have just started playing with Storybook for my react native app.

I followed the instruction on the page for "react-native-storybook-loader" and now when I run story book in the iOS simulator, I the error below

simulator screen shot - iphone 6 - 2018-02-02 at 15 14 03

@elderfo
Copy link
Owner

elderfo commented Mar 21, 2018

Were you able to resolve this issue? If so, can you post a sample repository that replicates this?

@hueter
Copy link

hueter commented May 15, 2018

I ran into this same issue, but I was able to fix it. For context, I am using storybook for a React project that was bootstrapped with react-native init rather than create-react-app (not sure if that matters).

The installation docs say:

Update index.js file in the ./storybook directory to point to storyLoader.js

But I found that the index.js file should stay the same (in my case at least), and merely updating the storybook/storybook.js instead made it work properly.

Here's the change that fixed it for me:
screen shot 2018-05-14 at 10 25 13 pm

Thanks for this super convenient package!

@bluenex
Copy link

bluenex commented Jun 27, 2018

@hueter thank you for a hint. Alhough I am able to run it, I've found another issue related to storybookjs/storybook#3348. The last comment on a thread points this out:

@a-golovanov:
The issue can be easily reproduced when storiesOf is called two or more times in a single js file (like in the auto-generated stories). Both calls try to set a dispose callback, but the metro "require" polyfill retains only the last one. Any modifications to that file will lead to the error.

Have anyone experienced this? Without HMR, we need to use Live Reload which resets state of Storybook and start at first page. Not so convenient. 🙁

@EskelCz
Copy link

EskelCz commented Sep 12, 2018

I'm having the same problem with the storybook v4.0.0-alpha.21, nothing stated in this thread helps.

@EskelCz
Copy link

EskelCz commented Sep 12, 2018

What worked for me (after dowgrading to version 3) was to use the regular storybook.js code:

import React, { Component } from 'react'
import { AppRegistry } from 'react-native'
import { getStorybookUI, configure } from '@storybook/react-native'
import { loadStories } from './storyLoader'

configure(() => {
  loadStories()
}, module)

const StorybookUIRoot = getStorybookUI({ port: 7007, onDeviceUI: false })

class StorybookUIHMRRoot extends Component {
  render () {
    return <StorybookUIRoot />
  }
}

AppRegistry.registerComponent('highlander', () => StorybookUIHMRRoot)
export default StorybookUIHMRRoot

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

5 participants