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

[0.57.0-rc.0] Error: Cannot find module 'metro/src/blacklist' on any react-native cli cmd #20799

Closed
fungilation opened this issue Aug 22, 2018 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@fungilation
Copy link

fungilation commented Aug 22, 2018

Environment

  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
      Memory: 8.52 GB / 15.95 GB
    Binaries:
      Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.4.0 - C:\Program Files\nodejs\npm.CMD

Description

Reproducible Demo

Running react-native upgrade or react-native run-android, I get

PS C:\Users\Gary\Documents\code\WonderSwipe> react-native upgrade
Scanning folders for symlinks in C:\Users\Gary\Documents\code\WonderSwipe\node_modules (28ms)
(node:16936) UnhandledPromiseRejectionWarning: Error: Cannot find module 'metro/src/blacklist'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Users\Gary\Documents\code\WonderSwipe\rn-cli.config.js:3:19)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._compile (C:\Users\Gary\Documents\code\WonderSwipe\node_modules\pirates\lib\index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (C:\Users\Gary\Documents\code\WonderSwipe\node_modules\pirates\lib\index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
(node:16936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Note that I ran yarn add react-native@0.57.0-rc.0 from RN 0.56.0 first, before react-native upgrade. react-native run-android is after I've manually upgraded. More details of other steps I took on hitting the metro blacklist error on #20710.

Unsure if possibly related to #20712.

My package.json
{
  "name": "wonderswipe",
  "version": "0.0.1",
  "private": true,
  "eslintConfig": {
    "parserOptions": {
      "ecmaVersion": 7,
      "sourceType": "module",
      "ecmaFeatures": {
        "jsx": true
      }
    },
    "env": {
      "browser": true,
      "node": true
    },
    "plugins": [
      "react",
      "react-native"
    ],
    "rules": {
      "comma-dangle": [
        2,
        "always-multiline"
      ],
      "semi": [
        2,
        "never"
      ],
      "react-native/no-unused-styles": 2,
      "react-native/split-platform-components": 2
    }
  },
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "babel-plugin-idx": "^2",
    "he": "^1.1.0",
    "lodash": "^4.17.2",
    "moment": "^2.19.0",
    "moment-timezone": "^0.5.10",
    "node-summary": "../node-summary",
    "react": "16.4.1",
    "react-native": "0.57.0-rc.0",
    "react-native-actionsheet": "^2.4.2",
    "react-native-blur": "^3.2.0",
    "react-native-cached-image": "../react-native-cached-image",
    "react-native-code-push": "^5.3",
    "react-native-custom-tabs": "^0.1.7",
    "react-native-easy-toast": "^1.0.9",
    "react-native-firebase": "^3.0",
    "react-native-fit-image": "^1.4.8",
    "react-native-flanimatedimage": "^0.4.0",
    "react-native-highlight-words": "^1.0.1",
    "react-native-keep-awake": "^3.0.1",
    "react-native-linear-gradient": "^2.0.0",
    "react-native-modalbox": "^1.6.0",
    "react-native-orientation": "^3.1.3",
    "react-native-parallax-scroll-view": "../react-native-parallax-scroll-view",
    "react-native-rate": "^1.0.8",
    "react-native-safari-view": "^2.0.0",
    "react-native-sentry": "^0.38.0",
    "react-native-sha256": "^1.1.1",
    "react-native-status-bar-size": "^0.3.2",
    "react-native-swiper": "../react-native-swiper",
    "react-native-tooltip": "^5.2.0",
    "react-native-tts": "^1.5.0",
    "react-native-vector-icons": "^4.1.1",
    "react-native-webview-bridge": "../react-native-webview-bridge-RN0.51",
    "react-redux": "^5.0.1",
    "redux": "^4.0.0",
    "redux-thunk": "^2.1.0"
  },
  "devDependencies": {
    "redux-logger": "^3.0.6"
  }
}
@rafeca
Copy link
Contributor

rafeca commented Aug 22, 2018

Can you post the contents of C:\Users\Gary\Documents\code\WonderSwipe\rn-cli.config.js? Is there any reference to metro/src/blacklist there?

@fungilation
Copy link
Author

Good one! rn-cli.config.js:

// WORKAROUND: https://github.com/oblador/react-native-vector-icons/issues/626#issuecomment-362386341
// to be fixed by https://github.com/facebook/react-native/pull/17672
const blacklist = require('metro/src/blacklist')
module.exports = {
  getBlacklistRE () {
    return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/])
  },
}

Is metro/src/blacklist not available in 0.57.0 for this workaround I have?

@rafeca
Copy link
Contributor

rafeca commented Aug 22, 2018

@fungilation it has been recently moved to the metro-config package: https://github.com/facebook/metro/blob/master/packages/metro-config/src/defaults/blacklist.js

@kelset
Copy link
Contributor

kelset commented Aug 23, 2018

It seems like you should simply update the path - and btw I suggest you also write a comment in the issue you link as "workaround" for good measure.

Anyway, if updating the path works please close this issue.

@fungilation
Copy link
Author

fungilation commented Aug 23, 2018

I see this PR is already in: 54dc11a which fixes and nullifies the need for the workaround. So I simply took out my pasted rn-cli.config.js. After smoothing out a few more issues on my side with 0.57, I got my app to both build and run android on Win 10! I'm surprised I'm not hitting errors in #20712. I'm still on 0.57.0-rc.0.

I'm seeing other peculiarities during app run time that's new to 0.57, I'll dig on whether those are bugs or changes that's undocumented and report back.

Thanks for the help here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants