流程:无法为此模块构建类型化接口

Flow: Cannot build a typed interface for this module

我在 运行 流动时遇到这些错误,但完全不确定原因:

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

这是因为您启用了类型优先架构,这意味着必须在模块边界处明确键入才能导出它。

您可以在此处了解更多信息