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

Scoped symlinks in node_modules not working #3138

Closed
nschnierer opened this issue Mar 3, 2018 · 3 comments
Closed

Scoped symlinks in node_modules not working #3138

nschnierer opened this issue Mar 3, 2018 · 3 comments

Comments

@nschnierer
Copy link

Issue details

Scoped symlinks (e.g. @babel/core) in node_modules not working with @storybook/react-native.
https://github.com/storybooks/storybook/blob/4465ffa25da33a47e9233756c627373ba39893c9/app/react-native/src/bin/storybook-start.js#L62

findSymlinksPaths is not able to find scoped symlinks. There is an closed pull-request for a fix (facebook/react-native#12400) but nothing happened yet, because metro is handling this part now.

Steps to reproduce

In lerna we are able to add dependencies as a symlink:

lerna add @boring/package --scope=@boring/storybook-native

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react-native 3.3.14

Affected platforms

macOS

@nschnierer
Copy link
Author

Got a workaround for this issue. With a haul (https://github.com/callstack/haul) config we are able to solve this problem (feature pull-request #1294 🙏).

Create a config file (e.g. haul.config.js):

const path = require('path');

module.exports = ({ platform }, defaults) => ({
  entry: `./storybook/index.${platform}.js`,
  resolve: {
    ...defaults.resolve,
    modules: [path.join(__dirname, 'node_modules')]
  }
});

Edit npm run storybook command in package.json:

"scripts": {
  "storybook": "storybook start -p 7007 --haul haul.config.js"
},

@stale
Copy link

stale bot commented Mar 29, 2018

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 Mar 29, 2018
@stale stale bot removed the inactive label Apr 2, 2018
@igor-dv
Copy link
Member

igor-dv commented Apr 2, 2018

Reopen if needed.

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

3 participants