Skip to content

Any way to deal with node_modules dependencies errors #5568

@rajat1saxena

Description

@rajat1saxena

Everytime I try to upgrade to latest version of flow, I get a new set of errors. This time I upgraded from 0.57.2 to 0.61.0 and following are the new errors I'm getting:

yarn run v1.3.2
$ flow
Error: node_modules/react-native/Libraries/Animated/src/Easing.js:65
 65:   static step0(n) {
                    ^ n. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:72
 72:   static step1(n) {
                    ^ n. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:82
 82:   static linear(t) {
                     ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:105
105:   static quad(t) {
                   ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:115
115:   static cubic(t) {
                    ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:125
125:   static poly(n) {
                   ^ n. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:126
126:     return (t) => Math.pow(t, n);
                 ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:134
134:   static sin(t) {
                  ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:143
143:   static circle(t) {
                     ^ t. Missing annotation

Error: node_modules/react-native/Libraries/Animated/src/Easing.js:152
152:   static exp(t) {
                  ^ t. Missing annotation

Error: node_modules/react-native/Libraries/CameraRoll/CameraRoll.js:258
258:   static getPhotos(params) {
                        ^^^^^^ params. Missing annotation

Error: node_modules/react-native/Libraries/Components/ScrollResponder.js:477
477:       var { animated, ...rect } = rect;
                           ^^^^^^^ rect. This type is incompatible with
472:     rect: { x: number, y: number, width: number, height: number, animated?: boolean },
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object type
  Property `animated` is incompatible:
    472:     rect: { x: number, y: number, width: number, height: number, animated?: boolean },
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `animated`. Property not found in
    477:       var { animated, ...rect } = rect;
                               ^^^^^^^ rect

Error: node_modules/react-native/Libraries/Share/Share.js:114
114:   static get sharedAction() { return 'sharedAction'; }
                                ^ return. Missing annotation

Error: node_modules/react-native/Libraries/Share/Share.js:120
120:   static get dismissedAction() { return 'dismissedAction'; }
                                   ^ return. Missing annotation

Error: node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js:27
 27:   static validateStyleProp(prop, style, caller) {
                                ^^^^ prop. Missing annotation

Error: node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js:27
 27:   static validateStyleProp(prop, style, caller) {
                                      ^^^^^ style. Missing annotation

Error: node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js:27
 27:   static validateStyleProp(prop, style, caller) {
                                             ^^^^^^ caller. Missing annotation

Error: node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js:62
 62:   static validateStyle(name, styles) {
                            ^^^^ name. Missing annotation

Error: node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js:62
 62:   static validateStyle(name, styles) {
                                  ^^^^^^ styles. Missing annotation


Found 19 errors
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tried fixing it with adding to following to .flowconfig's [ignore] category but then flow starts giving bunch of react-native: Required module not found errors.

; Ignore react native libraries as it's giving errors after upgrade to flow 0.61
<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions