question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imcompatible with Flow 0.99.0 and newer

See original GitHub issue

Hello! Sorry for removing the issue template.

I upgraded my project to Flow 0.99.0 from 0.98.1, and discovered that it throws new errors for this library.

Would you accept a PR fixing them?

It seems we hit this new feature from 0.99.0

Fix an issue where Flow would not catch certain errors involving React function components with unannotated props.

Errors:

Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/react-select/src/Select.js:442:23

Cannot assign defaultComponents(...) to this.components because:
 β€’ property children is missing in props [1] but exists in object type [2] in property Menu.
 β€’ property innerRef is missing in props [1] but exists in object type [2] in property Menu.

     node_modules/react-select/src/Select.js
     439β”‚     document.removeEventListener('scroll', this.onScroll, true);
     440β”‚   }
     441β”‚   cacheComponents = (components: SelectComponents) => {
     442β”‚     this.components = defaultComponents({ components });
     443β”‚   };
     444β”‚   // ==============================
     445β”‚   // Consumer Handlers

     node_modules/react-select/src/components/Menu.js
 [2] 225β”‚ export type MenuProps = MenuAndPlacerCommon & {
     226β”‚   /** Reference to the internal element, consumed by the MenuPlacer component */
     227β”‚   innerRef: ElementRef<*>,
     228β”‚   /** The children to be rendered. */
     229β”‚   children: ReactElement<*>,
     230β”‚ };

     node_modules/react-select/src/components/index.js
 [1]  64β”‚   Menu: ComponentType<MenuProps>,


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/react-select/src/animated/MultiValue.js:12:10

Cannot return function because:
 β€’ property in is missing in props [1].
 β€’ property onExited is missing in props [1].

      9β”‚ const AnimatedMultiValue = (
     10β”‚   WrappedComponent: AbstractComponent<MultiValueProps>
 [1] 11β”‚ ): AbstractComponent<MultiValueProps> => {
     12β”‚   return ({ in: inProp, onExited, ...props }) => (
     13β”‚     <Collapse in={inProp} onExited={onExited}>
     14β”‚       <WrappedComponent cropWithEllipsis={inProp} {...props} />
     15β”‚     </Collapse>
     16β”‚   );
     17β”‚ };
     18β”‚
     19β”‚ export default AnimatedMultiValue;


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/react-select/src/animated/Placeholder.js:11:4

Cannot create Fade element because:
 β€’ property in is missing in props [1] but exists in BaseTransition [2].
 β€’ property onExited is missing in props [1] but exists in BaseTransition [2].

     node_modules/react-select/src/animated/Placeholder.js
      8β”‚ const AnimatedPlaceholder = (
      9β”‚   WrappedComponent: AbstractComponent<PlaceholderProps>
     10β”‚ ): AbstractComponent<PlaceholderProps> => (props) => (
 [1] 11β”‚   <Fade
     12β”‚     component={WrappedComponent}
     13β”‚     duration={props.isMulti ? collapseDuration : 1}
     14β”‚     {...props}
     15β”‚   />
     16β”‚ );
     17β”‚
     18β”‚ export default AnimatedPlaceholder;

     node_modules/react-select/src/animated/transitions.js
 [2] 18β”‚ type FadeProps = BaseTransition & {


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/react-select/src/animated/SingleValue.js:12:4

Cannot create Fade element because:
 β€’ property duration is missing in props [1] but exists in object type [2].
 β€’ property in is missing in props [1] but exists in BaseTransition [3].
 β€’ property onExited is missing in props [1] but exists in BaseTransition [3].

        node_modules/react-select/src/animated/SingleValue.js
         9β”‚ const AnimatedSingleValue = (
        10β”‚   WrappedComponent: AbstractComponent<SingleValueProps>
        11β”‚ ): AbstractComponent<SingleValueProps> => (props) => (
    [1] 12β”‚   <Fade component={WrappedComponent} {...props} />
        13β”‚ );
        14β”‚
        15β”‚ export default AnimatedSingleValue;

        node_modules/react-select/src/animated/transitions.js
 [3][2] 18β”‚ type FadeProps = BaseTransition & {
        19β”‚   component: ComponentType<any>,
        20β”‚   duration: number,
        21β”‚ };


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/react-select/src/animated/index.js:14:10

Cannot return object literal because:
 β€’ property children is missing in props [1] but exists in object type [2] in property Menu.
 β€’ property innerRef is missing in props [1] but exists in object type [2] in property Menu.

     node_modules/react-select/src/animated/index.js
      11β”‚ const makeAnimated = (externalComponents?: SelectComponents= {}): SelectComponents => {
      12β”‚   const components = defaultComponents({ components: externalComponents });
      13β”‚   const { Input, MultiValue, Placeholder, SingleValue, ValueContainer, ...rest } = components;
      14β”‚   return {
      15β”‚     Input: AnimatedInput(Input),
      16β”‚     MultiValue: AnimatedMultiValue(MultiValue),
      17β”‚     Placeholder: AnimatedPlaceholder(Placeholder),
      18β”‚     SingleValue: AnimatedSingleValue(SingleValue),
      19β”‚     ValueContainer: AnimatedValueContainer(ValueContainer),
      20β”‚     ...rest,
      21β”‚   };
      22β”‚ };
      23β”‚
      24β”‚ const AnimatedComponents = makeAnimated();

     node_modules/react-select/src/components/Menu.js
 [2] 225β”‚ export type MenuProps = MenuAndPlacerCommon & {
     226β”‚   /** Reference to the internal element, consumed by the MenuPlacer component */
     227β”‚   innerRef: ElementRef<*>,
     228β”‚   /** The children to be rendered. */
     229β”‚   children: ReactElement<*>,
     230β”‚ };

     node_modules/react-select/src/components/index.js
 [1]  64β”‚   Menu: ComponentType<MenuProps>,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
breadadamscommented, Jul 17, 2019

In case it helps anyone - we’ve recently ran into this on a project were integrating the react-select library, and as a temporary fix added the following to the .flowconfig:

[ignore]
.*/node_modules/react-select/.*

However this results in another error where importing the library:

Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ src/components/Select/index.js:3:44

Cannot resolve module react-select.

     1β”‚ // @flow
     2β”‚ import React from 'react';
     3β”‚ import Select from 'react-select';

So in addition to the above, mark the import line with $FlowFixMe (all this until #3626 is resolved).

1reaction
bladeycommented, Jun 18, 2020

It appears this will be resolved when PR #3626 is merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flow-type throws error with Selectprops Β· Issue #3804 - GitHub
All branches are incompatible: β€’ Either property selectProps is missing in PropsWithStyles [1]. β€’ Or property selectProps is missing in objectΒ ...
Read more >
Flow type error: "number [1] is incompatible with `Number` [2 ...
You need to change index: Number,. to be index: number,. A Number is an object, number is a primitive type.
Read more >
Read more - GitHub
0.101.0 Likely to cause new Flow errors: * `$Keys` now produces a more precise type, which may find errors where incompatible strings were...
Read more >
Coronary Flow Velocity and Disturbed Flow Predict Adverse ...
We hypothesized that disturbed blood flow after coronary angioplasty is associated with adverse long-term clinical outcome. Methods and Resultsβ€” TheΒ ...
Read more >
Quantitative Evaluation of Post-stenotic Blood Flow ... - NCBI
V Flow was used to measure femoral artery flow turbulence index (Tur) ... Zhu L. High frame rate vector flow imaging: Development as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found