React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Memory: 440.67 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/local/opt/node@8/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/opt/node@8/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 21.1.1, 21.1.2, 22.0.0, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.2, 27.0.3, 28.0.0
API Levels: 22, 24, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4697961
Xcode: 10.0/10A254a - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
(node:94806) UnhandledPromiseRejectionWarning: Error: Cannot find module 'metro/src/blacklist'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
Can you run react-native info and edit your issue to include these results under the Environment section?
If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.
If you bot could read, you would realize that I DID run react-native info, but it did not work!
Are you using a custom rn-cli.config.js?
If yes, you should update the code related to requiring blacklist to something like:
try {
// >= 0.57
blacklist = require('metro-config/src/defaults/blacklist');
} catch (e) {
// <= 0.56
blacklist = require('metro/src/blacklist');
}
I'm not using a custom rn-cli.config.js. But the one in the project directory looks like this:
const blacklist = require('metro/src/blacklist')
module.exports = {
getBlacklistRE () {
return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/])
},
}
Maybe you should try to rm -rf node_modules; yarn.
I have removed node_modules. But I changed the rn-cli.config.js per your instructions and at least now got the react-native info working. Probably the metro bundler too. Next have to figure out how to resolve the RN issues with XCode 10 GM. Really hate wasting time with fighting with buggy RN...
You will need to update the rn-cli.config.js per the upgrade guide. https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#updating-to-this-version see point number 4
change the blacklist import to.
const blacklist = require('metro-config/src/defaults/blacklist')
Whats in the line // ... where alternateRoots should be defined? Would be nice to have the whole file in the guide.
Also: (node:17719) UnhandledPromiseRejectionWarning: Error: Cannot find module './scripts/transformer.js'
This is your new file.
const blacklist = require('metro-config/src/defaults/blacklist')
module.exports = {
getBlacklistRE () {
return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/])
},
}
Sorry, I just realised the blackListing reference is incorrect, it should be.
const blacklist = require('metro-config/src/defaults/blacklist')
module.exports = {
resolver: {
blacklistRE: blacklist([/react-native\/local-cli\/core\/__fixtures__.*/]),
},
};
I feel that we can close this now, since this is also shown in the changelog for 0.57 https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#updating-to-this-version
Most helpful comment
Are you using a custom
rn-cli.config.js?If yes, you should update the code related to requiring
blacklistto something like: