Skip to content

Whole lotta Flow errors (react-native MaskedView & metro-bundler) #15145

Closed
@Palisand

Description

@Palisand

Feast your eyes:

node_modules/metro-bundler/build/node-haste/DependencyGraph/HasteMap.js.flow:64
 64:     (this: any)._processHastePackage = throat(1, this._processHastePackage.bind(this));
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function call. Could not decide which case to select
 64:     (this: any)._processHastePackage = throat(1, this._processHastePackage.bind(this));
                                            ^^^^^^ intersection type
  Case 1 may work:
    3: declare function throat<TResult, TFn: (...args: Array<any>) => Promise<TResult>>(size: number, fn: TFn): TFn;
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ polymorphic type: function type. See: node_modules/throat/index.js.flow:3
  But if it doesn't, case 3 looks promising too:
    5: declare function throat(size: number): <TResult>(fn: () => Promise<TResult>) => Promise<TResult>;
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See: node_modules/throat/index.js.flow:5
  Please provide additional annotation(s) to determine whether case 1 works (or consider merging it with case 3):
  165:   _processHastePackage(file: string, previousName: ?string) {
                                                                  ^ return

node_modules/metro-bundler/build/node-haste/DependencyGraph/HasteMap.js.flow:65
 65:     (this: any)._processHasteModule = throat(1, this._processHasteModule.bind(this));
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function call. Could not decide which case to select
 65:     (this: any)._processHasteModule = throat(1, this._processHasteModule.bind(this));
                                           ^^^^^^ intersection type
  Case 1 may work:
    3: declare function throat<TResult, TFn: (...args: Array<any>) => Promise<TResult>>(size: number, fn: TFn): TFn;
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ polymorphic type: function type. See: node_modules/throat/index.js.flow:3
  But if it doesn't, case 3 looks promising too:
    5: declare function throat(size: number): <TResult>(fn: () => Promise<TResult>) => Promise<TResult>;
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See: node_modules/throat/index.js.flow:5
  Please provide additional annotation(s) to determine whether case 1 works (or consider merging it with case 3):
  150:   _processHasteModule(file: string, previousName: ?string) {
                                                                 ^ return

node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js:70
 70:   static propTypes = {
                          ^ property `onLayout`. Property not found in any member of intersection type
 49:   static propTypes: $Subtype<{[_: $Keys<Props>]: any}>; //object whose keys are in PropTypes
                                       ^^^^^^^^^^^^ intersection. See lib: /private/tmp/flow/flowlib_3a47f599/react.js:49
  Member 1:
   22: type Props = ViewProps & {
                    ^^^^^^^^^ ViewProps
  Error:
   70:   static propTypes = {
                            ^ property `onLayout`. Property not found in any member of intersection type
   22: type Props = ViewProps & {
                    ^^^^^^^^^ intersection
    Member 1:
     41: export type ViewProps = {
                                 ^ object type. See: node_modules/react-native/Libraries/Components/View/ViewPropTypes.js:41
    Error:
     70:   static propTypes = {
                              ^ property `onLayout`. Property not found in
     41: export type ViewProps = {
                                 ^ object type. See: node_modules/react-native/Libraries/Components/View/ViewPropTypes.js:41
    Member 2:
     71: } & TVViewProps;
             ^^^^^^^^^^^ TVViewProps. See: node_modules/react-native/Libraries/Components/View/ViewPropTypes.js:71
    Error:
     70:   static propTypes = {
                              ^ property `onLayout`. Property not found in
     71: } & TVViewProps;
             ^^^^^^^^^^^ object type. See: node_modules/react-native/Libraries/Components/View/ViewPropTypes.js:71
  Member 2:
   22: type Props = ViewProps & {
                                ^ object type
  Error:
   70:   static propTypes = {
                            ^ property `onLayout`. Property not found in
   22: type Props = ViewProps & {
                                ^ object type

node_modules/react-native/RNTester/js/MaskedViewExample.js:73
 73:             <MaskedViewIOS
                 ^ React element `MaskedViewIOS`
 22: type Props = ViewProps & {
                              ^ property `children`. Property not found in. See: node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js:22
 73:             <MaskedViewIOS
                 ^ props of React element `MaskedViewIOS`

node_modules/react-native/RNTester/js/MaskedViewExample.js:95
 95:             <MaskedViewIOS
                 ^ React element `MaskedViewIOS`
 22: type Props = ViewProps & {
                              ^ property `children`. Property not found in. See: node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js:22
 95:             <MaskedViewIOS
                 ^ props of React element `MaskedViewIOS`

node_modules/react-native/RNTester/js/MaskedViewExample.js:120
120:             <MaskedViewIOS
                 ^ React element `MaskedViewIOS`
 22: type Props = ViewProps & {
                              ^ property `children`. Property not found in. See: node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js:22
120:             <MaskedViewIOS
                 ^ props of React element `MaskedViewIOS`

node_modules/react-native/RNTester/js/MaskedViewExample.js:153
153:             <MaskedViewIOS
                 ^ React element `MaskedViewIOS`
 22: type Props = ViewProps & {
                              ^ property `children`. Property not found in. See: node_modules/react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js:22
153:             <MaskedViewIOS
                 ^ props of React element `MaskedViewIOS`

(I am not using MaskedView)

Updating to a newer version of RN never fails to bring a slew of flow issues... why, why must it be so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions