Storybook: Unable to resolve module "rn-host-detect"

Created on 3 Dec 2019  路  5Comments  路  Source: storybookjs/storybook

Describe the bug
After upgrading react-native from 0.59 to 0.61, in which they introduced fast refresh, there were several issues with Storybook (always loading with addon page opened, and throwing different errors on code change forcing me to reload every time I changed the code). I read that at least the addon always being shown had been resolved, and therefore wanted to update storybook, because it sucked to click and close this and that all the time.

However, after updating I have bigger problems, which forces me to downgrade again:

"Unable to resolve module `rn-host-detect` from `node_modules/@storybook/react-native/dist/preview/index.js`: rn-host-detect could not be found within the project."

To Reproduce
Install storybook v5.3.0-beta.14 and run the app.

Expected behavior
I would expect it to work.

System:

  System:
    OS: macOS 10.15.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.19.2 - ~/.yarn/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.108
    Safari: 13.0.3
  npmPackages:
    @storybook/addon-storyshots: v5.3.0-beta.14 => 5.3.0-beta.14
    @storybook/addons: v5.3.0-beta.14 => 5.3.0-beta.14
    @storybook/react-native: v5.3.0-beta.14 => 5.3.0-beta.14
    @storybook/react-native-server: v5.3.0-beta.14 => 5.3.0-beta.14

Additional context
If you need any other information, please let me know :)

react-native question / support

Most helpful comment

Can you install 5.3.0-beta.19 and make sure to use react-native start --reset-cache ?

All 5 comments

@jenskuhrjorgensen, are you installing all the same versions for @storybook/* dependencies? rn-host-detect is not used anymore at the moment, so it seems like you are installing older version somewhere.

Hi @Gongreg

Thank you for your answer.

Hmm, interesting. As far as I can see, the only other Storybook related things in my package.json are "@sambego/storybook-state": "1.3.6", and "react-native-storybook-loader": "1.8.0", but I don't think they are installing any @storybook/* dependencies. Amarite?

Would I help debugging it, if I ran some npm command showing all installed dependencies and grepping the ones starting with @storybook/?

Can you install 5.3.0-beta.19 and make sure to use react-native start --reset-cache ?

Awesome, it works! 馃槃 Thanks a bunch

Glad to help :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bpeab picture bpeab  路  70Comments

joeruello picture joeruello  路  79Comments

43081j picture 43081j  路  61Comments

dependencies[bot] picture dependencies[bot]  路  142Comments

Olian04 picture Olian04  路  78Comments