facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.23k forks source link

error blacklist is not defined. Run CLI with --verbose flag for more details. #732

Open jiapei100 opened 5 years ago

jiapei100 commented 5 years ago

Looks like metro blacklist.js is missing?

error blacklist is not defined. Run CLI with --verbose flag for more details.

What version of metro should be installed?

Cheers

firdausious commented 5 years ago

@jiapei100 just change

var blacklist = require('metro/src/blacklist');

to

var blacklist = require('metro-config/src/defaults/blacklist');

Which version of React Native / React that you used ?

jiapei100 commented 5 years ago

@firdausious Thank you for your reply...

  1. Modified ALREADY...
longervision-GT72-6QE% grep -rwn "blacklist"
rn-cli.config.js:4:var blacklist = require('metro-config/src/defaults/blacklist');
rn-cli.config.js:12:    return blacklist([
  1. react-native should be of version 0.60.5
longervision-GT72-6QE% npm show react-native

react-native@0.60.5 | MIT | deps: 28 | versions: 314
A framework for building native apps using React
https://github.com/facebook/react-native#readme

bin: react-native

dist
.tarball: https://registry.npmjs.org/react-native/-/react-native-0.60.5.tgz
.shasum: 3c1d9c06a0fbab9807220b6acac09488d39186ee
.integrity: sha512-cZwI0XzzihACN+7an1Dy46A83FRaAe2Xyd7laCalFFAppZIYeMVphZQWrVljJk5kIZBNtYG35TY1VsghQ0Oc2Q==
.unpackedSize: 24.4 MB

dependencies:
@babel/runtime: ^7.0.0                               fbjs: ^1.0.0                                         
@react-native-community/cli-platform-android: ^2.6.0 hermesvm: ^0.1.0                                     
@react-native-community/cli-platform-ios: ^2.4.1     invariant: ^2.2.4                                    
@react-native-community/cli: ^2.6.0                  jsc-android: 245459.0.0                              
abort-controller: ^3.0.0                             metro-babel-register: 0.54.1                         
art: ^0.10.0                                         metro-react-native-babel-transformer: 0.54.1         
base64-js: ^1.1.2                                    metro-source-map: ^0.55.0                            
connect: ^3.6.5                                      nullthrows: ^1.1.0                                   
create-react-class: ^15.6.3                          pretty-format: ^24.7.0                               
escape-string-regexp: ^1.0.5                         promise: ^7.1.1                                      
event-target-shim: ^5.0.1                            prop-types: ^15.7.2                                  
fbjs-scripts: ^1.1.0                                 react-devtools-core: ^3.6.1                          
(...and 4 more.)

maintainers:
- cpojer <christoph.pojer@gmail.com>
- fb <opensource+npm@fb.com>
- grabbou <grabbou@gmail.com>
- hectorramos <hector@hectorramos.com>
- react-native-bot <opensource+react-native-bot@fb.com>

dist-tags:
latest: 0.60.5     next: 0.61.0-rc.2  

published 3 weeks ago by react-native-bot <opensource+react-native-bot@fb.com>
longervision-GT72-6QE% 
  1. Current issue is caused by node-gyp
longervision-GT72-6QE% npm install

> weak-napi@1.0.3 install ....../mysite/node_modules/weak-napi
> node-gyp rebuild

make: Entering directory '....../mysite/node_modules/weak-napi/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
  AR(target) Release/obj.target/../node-addon-api/src/nothing.a
  COPY Release/nothing.a
  CXX(target) Release/obj.target/weakref/src/weakref.o
In file included from ../src/weakref.cc:2:
....../mysite/node_modules/setimmediate-napi/include/setimmediate.h: In instantiation of ‘void SetImmediate(napi_env, T&&) [with T = {anonymous}::ObjectInfo::OnFree()::<lambda()>; napi_env = napi_env__*]’:
../src/weakref.cc:25:6:   required from here
....../mysite/node_modules/setimmediate-napi/include/setimmediate.h:46:7: warning: catching polymorphic type ‘class Napi::Error’ by value [-Wcatch-value=]
     } catch (Napi::Error e) {
       ^~~~~
  SOLINK_MODULE(target) Release/obj.target/weakref.node
  COPY Release/weakref.node
make: Leaving directory '....../mysite/node_modules/weak-napi/build'

> core-js@3.2.1 postinstall ....../mysite/node_modules/@babel/register/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@2.6.9 postinstall ....../mysite/node_modules/fbjs-scripts/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@2.6.9 postinstall ....../mysite/node_modules/metro-babel-register/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@2.6.9 postinstall ....../mysite/node_modules/metro/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@2.6.9 postinstall ....../mysite/node_modules/react-native/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> electron@5.0.10 postinstall ....../mysite/node_modules/electron
> node install.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1461 packages from 593 contributors and audited 352472 packages in 17.861s
found 0 vulnerabilities
  1. Without any revision, just run npm start
longervision-GT72-6QE% npm start

> longervision.us@0.0.1 start ....../mysite
> node node_modules/react-360/scripts/packager.js

open browser at http://localhost:8081/index.html

Starting React Native Packager...
● Validation Warning:

  Unknown option "getProjectRoots" with value getProjectRoots() {
    return getRoots();
  } was found.
  This is probably a typing mistake. Fixing it will remove this message.

● Validation Warning:

  Unknown option "getBlacklistRE" with value getBlacklistRE() {
    return blacklist([
    ]);
  } was found.
  This is probably a typing mistake. Fixing it will remove this message.

● Validation Warning:

  Unknown option "getAssetExts" with value getAssetExts() {
    return ['obj', 'mtl'];
  } was found.
  This is probably a typing mistake. Fixing it will remove this message.

● Validation Warning:

  Unknown option "getPlatforms" with value getPlatforms() {
    return ['vr'];
  } was found.
  This is probably a typing mistake. Fixing it will remove this message.

● Validation Warning:

  Unknown option "getProvidesModuleNodeModules" with value getProvidesModuleNodeModules() {
    return ['react-native', 'react-360'];
  } was found.
  This is probably a typing mistake. Fixing it will remove this message.

┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Looking for JS files in
   ....../mysite 

Loading dependency graph, done.
 BUNDLE  [vr, dev] ./client.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (137/137), done.

::1 - - [06/Sep/2019:07:14:05 +0000] "GET /favicon.ico HTTP/1.1" 404 150 "http://localhost:8081/index.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/76.0.3809.100 Chrome/76.0.3809.100 Safari/537.36"

http://localhost:8081/index.html did load a black background, without the foreground images. Namely, there is NO 360 panorama effects to display.

Can you please help?

Cheers

mcruz20 commented 4 years ago

I found a solution. If you're using react native >= 0.59 change your file name rn-cli.config.js to metro.config.js.

Then change your code, for example:

const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
    getBlacklistRE() {
        return blacklist([
            /scripts\/.*/,
        ]);
    },
};

To:

const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
    resolver: {
        blacklistRE: blacklist([/scripts\/.*/])
    },
};

Following the documentation from metro.