Flow: "unexpected typeapp: EmptyT" error after upgrading to flow 0.70.0

Created on 23 Apr 2018  ยท  4Comments  ยท  Source: facebook/flow

After upgrading from flow 0.69.0 to 0.70.0 I am now seeing the following flow errors:

Error โ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ node_modules/ux/src/FileUpload/FileUpload.js.flow:67:17

Internal error: unexpected typeapp: EmptyT

     64โ”‚    static defaultProps = {
     65โ”‚        defaultText: 'Click here or drag and drop a file to begin upload',
     66โ”‚        isOver: false,
     67โ”‚        onUpload: (): Promise<any> => Promise.resolve(),
     68โ”‚        releaseText: 'Release to begin upload...',
     69โ”‚        uploadingText: 'Uploading...',
     70โ”‚    };


Error โ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ node_modules/ux/src/FileUpload/FileUpload.js.flow:213:49

Internal error: unexpected typeapp: EmptyT

     210โ”‚    * Handler for the file drop event on the file uploader
     211โ”‚    */
     212โ”‚   // eslint-disable-next-line react/no-unused-prop-types
     213โ”‚   _handleDrop = ({files}: {files: Array<File>}): Promise<any> => {
     214โ”‚       // Validate files
     215โ”‚       const validationError = this._validate(files);
     216โ”‚       if (validationError) {


Error โ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ node_modules/ux/src/FileUpload/FileUpload.js.flow:240:55

Internal error: unexpected typeapp: EmptyT

     237โ”‚   /*
     238โ”‚    * Handle for the file upload select event
     239โ”‚    */
     240โ”‚   _handleInputSelect = (event: SyntheticInputEvent<>): Promise<any> => {
     241โ”‚       event.preventDefault();
     242โ”‚
     243โ”‚       // Find file objects

The errors all seem to be pointing at the Promise<*> definitions inside a third-party node_module library I'm using.

I've tried modifying the Promise type definitions to be more specific but that doesn't seem to make any difference. Changing the Promise type definitions to any in the third-party library code makes the issues go away. So it seems to be something to do with the default Promise type definition inside Flow itself.

Rolling back to flow 0.69.0 makes the issues go away.

Could anyone suggest any ideas about what unexpected typeapp: EmptyT might be referring to and what it may have to do with the Promise type definitions?

bug

Most helpful comment

@StreetStrider @mrkev I've logged https://github.com/facebook/flow/issues/6284 for that.

All 4 comments

This is still an issue with [email protected]

Seemes on 0.72 this mutated into Internal error: unexpected typeapp: MergedT.

Feel free to open another issue with information on how to reproduce

@StreetStrider @mrkev I've logged https://github.com/facebook/flow/issues/6284 for that.

Was this page helpful?
0 / 5 - 0 ratings