Flow: Cannot build a typed interface for this module

Viewed 5872

I'm getting these errors when I run flow but not sure at all why:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/Typeahead.js:272:9

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     269│ Typeahead.propTypes = {
     270│   id: PropTypes.string,
     271│   onChange: PropTypes.func,
     272│   data: PropTypes.arrayOf(
     273│     PropTypes.exact({
     274│       label: PropTypes.string.isRequired,
     275│       value: PropTypes.string.isRequired,
     276│     })
     277│   ),
     278│   placeholder: PropTypes.string,
     279│   size: PropTypes.oneOf(['md', 'lg']),
     280│   searchField: PropTypes.string,


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/Typeahead.js:279:9

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     276│     })
     277│   ),
     278│   placeholder: PropTypes.string,
     279│   size: PropTypes.oneOf(['md', 'lg']),
     280│   searchField: PropTypes.string,
     281│   onBlur: PropTypes.func,
     282│   onFocus: PropTypes.func,


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/Typeahead.js:284:16

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     281│   onBlur: PropTypes.func,
     282│   onFocus: PropTypes.func,
     283│   onSelect: PropTypes.func,
     284│   defaultItem: PropTypes.exact({
     285│     label: PropTypes.string.isRequired,
     286│     value: PropTypes.string.isRequired,
     287│   }),
     288│   noResultText: PropTypes.string,
     289│ };
     290│


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/TypeaheadInputField.js:193:16

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     190│ };
     191│ forwardRefInputField.displayName = 'InputField';
     192│
     193│ export default React.forwardRef<Props, HTMLInputElement>(forwardRefInputField);
     194│


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/TypeaheadOption.js:79:11

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     76│ Option.displayName = 'Option';
     77│
     78│ Option.propTypes = {
     79│   option: PropTypes.exact({
     80│     label: PropTypes.string.isRequired,
     81│     value: PropTypes.string.isRequired,
     82│   }),
     83│   selected: PropTypes.exact({
     84│     label: PropTypes.string.isRequired,
     85│     value: PropTypes.string.isRequired,


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/gestalt/src/TypeaheadOption.js:83:13

Cannot build a typed interface for this module. You should annotate the exports of this module with types. Cannot
determine the type of this call expression. Please provide an annotation, e.g., by adding a type cast around this
expression. [signature-verification-failure]

     80│     label: PropTypes.string.isRequired,
     81│     value: PropTypes.string.isRequired,
     82│   }),
     83│   selected: PropTypes.exact({
     84│     label: PropTypes.string.isRequired,
     85│     value: PropTypes.string.isRequired,
     86│   }),
     87│   searchField: PropTypes.string,
     88│   handleSelect: PropTypes.func,
     89│ };



Found 6 errors
1 Answers

This is because you have the types first architecture enabled which means that at module boundaries must be explicitly typed before you can export it.

You can learn more about it here What is the "types first" Flow architecture?

Related