React-native: Flow errors pre existing when initiating react-native

Created on 22 Jan 2017  路  4Comments  路  Source: facebook/react-native

I have created a react-native project from scratch.

react-native init AwesomeProject
cd AwesomeProject
react-native run-android

And when running flow from the command line I got the following 11 errors most of them related to the react packager.

node_modules/react-native/Libraries/Performance/Systrace.js:216
216:   require.Systrace = Systrace;
               ^^^^^^^^ property `Systrace`. Property not found in
216:   require.Systrace = Systrace;
       ^^^^^^^ object type

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:74
 74: //$FlowIssue #14640206
     ^^^^^^^^^^^^^^^^^^^^^^ Error suppressing comment. Unused suppression

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:116
116:   //$FlowIssue #14640206
       ^^^^^^^^^^^^^^^^^^^^^^ Error suppressing comment. Unused suppression

node_modules/react-native/packager/react-packager/src/Server/index.js:267
267:               if (deps.files.has(filePath)) {
                            ^^^^^ property `files`. Property cannot be accessed on possibly undefined value
267:               if (deps.files.has(filePath)) {
                       ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:268
268:                 deps.outdated.add(filePath);
                          ^^^^^^^^ property `outdated`. Property cannot be accessed on possibly undefined value
268:                 deps.outdated.add(filePath);
                     ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:560
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                    ^^^^^^^^^^^^^^^ property `dependencyPairs`. Property cannot be accessed on possibly undefined value
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                                                   ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:560
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                     ^^^^^ property `files`. Property cannot be accessed on possibly undefined value
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                                                   ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:560
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                            ^^^^^^^^^ property `idToIndex`. Property cannot be accessed on possibly undefined value
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                                                   ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:560
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                                       ^^^^^^^^ property `outdated`. Property cannot be accessed on possibly undefined value
560:         const {dependencyPairs, files, idToIndex, outdated} = deps;
                                                                   ^^^^ undefined

node_modules/react-native/packager/react-packager/src/Server/index.js:573
573:           deps.outdated = new Set();
                    ^^^^^^^^ property `outdated`. Property cannot be assigned on possibly undefined value
573:           deps.outdated = new Set();
               ^^^^ undefined

node_modules/react-native/packager/react-packager/src/node-haste/ModuleCache.js:117
117:       if (this._packageCache[packagePath]) {
                                  ^^^^^^^^^^^ undefined. This type is incompatible with
 36:   _packageCache: {[filePath: string]: Package};
                                  ^^^^^^ string


Found 11 errors
  • react-native-cli: 2.0.1
  • react-native: 0.40.0
  • flowtype: 0.37.4
Locked

Most helpful comment

I'm also seeing something similar after upgrading to 0.41.0-rc.0

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:74
 74: const nullByteBuffer: Buffer = new Buffer(1).fill(0);
                                    ^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
 74: const nullByteBuffer: Buffer = new Buffer(1).fill(0);
                           ^^^^^^ Buffer

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:115
115:   const table: Buffer = new Buffer(entryOffset(numEntries)).fill(0);
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
115:   const table: Buffer = new Buffer(entryOffset(numEntries)).fill(0);
                    ^^^^^^ Buffer

Also seems similar to this so linking the two here: https://github.com/facebook/react-native/issues/11655

All 4 comments

I'm also seeing something similar after upgrading to 0.41.0-rc.0

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:74
 74: const nullByteBuffer: Buffer = new Buffer(1).fill(0);
                                    ^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
 74: const nullByteBuffer: Buffer = new Buffer(1).fill(0);
                           ^^^^^^ Buffer

node_modules/react-native/local-cli/bundle/output/unbundle/as-indexed-file.js:115
115:   const table: Buffer = new Buffer(entryOffset(numEntries)).fill(0);
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
115:   const table: Buffer = new Buffer(entryOffset(numEntries)).fill(0);
                    ^^^^^^ Buffer

Also seems similar to this so linking the two here: https://github.com/facebook/react-native/issues/11655

+1

currently 135 errors with

  • Flow 0.39.0
  • react-native 0.41.2

is there any way to suppress them?

Ongoing discussion in issue #11655 also.

Was this page helpful?
0 / 5 - 0 ratings