viewstools / yarn-workspaces-cra-crna

How to use yarn workspaces with Create React App and Create React Native App (Expo) to share common code across
151 stars 23 forks source link

import of metro-bundler needs to be updated to just 'metro' #10

Open nick-michael opened 6 years ago

nick-michael commented 6 years ago

You can still install the 'metro-bundler' node module separately, but the bundle that gets created as part of CRNA currently puts the blacklist file under 'metro'

The blacklist import needs to be updated const blacklist = require('metro-bundler/src/blacklist') becomes => const blacklist = require('metro/src/blacklist')

amcvitty commented 6 years ago

Yes, I found this also (and wasted a few hours trying to figure it out!)

https://github.com/facebook/react-native/commit/654fed46f49b5002096ff55c2e8523af48b22c24#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

menor commented 6 years ago

In case someone else has this problem, and can't wait. I fixed it temporarily by creating a symbolic link from metro-bundler to metro putting this in my package.json

  "scripts": {
    "crna-workspaces-hack": "cd node_modules && ln -s metro metro-bundler",
    "postinstall": "npm run crna-workspaces-hack"
  }