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

Storybook does not work with RN0.59.+ #6452

Closed
MaxToyberman opened this issue Apr 8, 2019 · 15 comments
Closed

Storybook does not work with RN0.59.+ #6452

MaxToyberman opened this issue Apr 8, 2019 · 15 comments

Comments

@MaxToyberman
Copy link

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

@shilman
Copy link
Member

shilman commented Apr 8, 2019

Which version of storybook?

@jgcmarins
Copy link

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,
      },
    }),
  },
};

@MaxToyberman
Copy link
Author

@shilman 3.4.12 latest on npm

@shilman
Copy link
Member

shilman commented Apr 10, 2019

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)?

@MaxToyberman
Copy link
Author

@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".

@shilman
Copy link
Member

shilman commented Apr 10, 2019

@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.

@MaxToyberman
Copy link
Author

@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",

@shilman
Copy link
Member

shilman commented Apr 10, 2019

@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 shilman added this to the 5.1.0 milestone Apr 10, 2019
@MaxToyberman
Copy link
Author

@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

@MaxToyberman
Copy link
Author

MaxToyberman commented Apr 10, 2019

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

@stale
Copy link

stale bot commented May 1, 2019

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!

@stale stale bot added the inactive label May 1, 2019
barbosa added a commit to loadsmart/blocks that referenced this issue May 21, 2019
see: storybookjs/storybook#6452
issue above still open as of today
@stale
Copy link

stale bot commented May 22, 2019

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!

@benoitdion
Copy link
Member

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

@stale stale bot removed the inactive label May 27, 2019
barbosa added a commit to loadsmart/blocks that referenced this issue Jun 1, 2019
see: storybookjs/storybook#6452
issue above still open as of today
@shilman shilman modified the milestones: 5.1.0, 5.1.x Jun 5, 2019
@stale
Copy link

stale bot commented Jun 26, 2019

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!

@stale stale bot added the inactive label Jun 26, 2019
@stale
Copy link

stale bot commented Jul 26, 2019

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!

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

4 participants