Storybook: Storybook does not work with RN0.59.+

Created on 8 Apr 2019  路  15Comments  路  Source: storybookjs/storybook

Describe the bug
Unable to load findSymlinksPaths: Cannot find module 'react-native/local-cli/util/findSymlinksPaths'

error: unknown option `--projectRoots'

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to latest react-native version
  2. run storybook start -p 7007 | react-native start --projectRoot storybook

Additional context
I think the problem is because the path is wrong, now the cli is from @react-community/cli

react-native inactive question / support

Most helpful comment

The solution for me was to modify package.json to :

    "@storybook/addon-actions": "4.0.11",
    "@storybook/addon-knobs": "4.0.11",
    "@storybook/addon-links": "4.0.11",
    "@storybook/addon-ondevice-knobs": "4.1.16",
    "@storybook/addon-ondevice-notes": "4.0.11",
    "@storybook/addons": "4.0.11",
    "@storybook/react-native": "4.0.11",

work well with react-native 0.59.2

All 15 comments

Which version of storybook?

I've solved this adding react-dom as devDep
and then adding this to metro.config.js:

const path = require('path');

module.exports = {
  projectRoot: path.resolve(__dirname, '.'),

  watchFolders: [
    path.resolve(__dirname, 'node_modules'),
  ],

  resolver: {
    // https://github.com/facebook/metro/issues/1#issuecomment-453450709
    extraNodeModules: new Proxy({}, {
      get: (target, name) => path.join(process.cwd(), `node_modules/${name}`),
    }),
  },

  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
};

@shilman 3.4.12 latest on npm

Oh wow. Any reason you're not upgrading to 4.x or 5.1-alpha.x (other than that upgrading can be a pain in the neck)?

@shilman actually i have tried to use version 4.1.16 which is using "airbnb-js-shims" which is using "promise.prototype.finally" . and then i have another error "finally is undefined".

@benoitdion @Gongreg have you seen this airbnb-js-shims issue on 4.x?

@MaxToyberman Perhaps @jgcmarins workaround will work for you on 3.4? If not, I suggest trying to upgrade to 5.1-alpha. All active development is going on there, so you're much more likely to get help if you're running latest. We just don't have the resources to go back and support RN59 in old versions of storybook unless it's community-contributed.

@shilman the same problem on 5.1-alpha, my dependecies:


"@storybook/addon-actions": "5.0.6",
    "@storybook/addon-knobs": "5.0.6",
    "@storybook/addon-ondevice-knobs": "4.1.16",
    "@storybook/addon-ondevice-notes": "4.1.16",
    "@storybook/addons": "5.0.6",
    "@storybook/react-native": "5.1.0-alpha.24",

@MaxToyberman I don't think this will solve the problem, but in general keep all your @storybook/* to the same version (in this case 5.1.0-alpha.24). Also did you follow the 5.1 migration instructions (possibly not relevant): https://github.com/storybooks/storybook/blob/next/MIGRATION.md#react-native-server

@benoitdion any idea what's going on here?

@shilman I have created a new empty project and added storybook with : npx -p @storybook/cli sb init --type react_native

then i write :

    fetch("https://google.com")
      .then(res => {})
      .catch(e => {
        console.log("finally");
      })
      .finally(() => {
        console.log("finally");
      });

i get this error :

Simulator Screen Shot - iPhone 6 - 2019-04-10 at 14 43 39

The solution for me was to modify package.json to :

    "@storybook/addon-actions": "4.0.11",
    "@storybook/addon-knobs": "4.0.11",
    "@storybook/addon-links": "4.0.11",
    "@storybook/addon-ondevice-knobs": "4.1.16",
    "@storybook/addon-ondevice-notes": "4.0.11",
    "@storybook/addons": "4.0.11",
    "@storybook/react-native": "4.0.11",

work well with react-native 0.59.2

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@MaxToyberman are you still seeing the issue with the latest 5.1 RC?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Was this page helpful?
0 / 5 - 0 ratings