Skip to content

Flow error Promise #22101

Closed
Closed

Description

@exced

Environment

[skip envinfo]

Description

It seems there's a Flow type Error in Libraries/Core/polyfillPromise.js

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ Libraries/Core/polyfillPromise.js:21:33

Importing from an untyped module makes it any and is not safe! Did you mean to add // @flow to the top of Promise?
(untyped-import)

 18│  * If you don't need these polyfills, don't use InitializeCore; just directly
 19│  * require the modules you need from InitializeCore for setup.
 20│  */
 21│ polyfillGlobal('Promise', () => require('Promise'));
 22│

This error could be solved by changing // @flow strict-local annotation to // @flow in Libraries/Core/polyfillPromise.js file but I guess we would like to fix the error in Promise module.

Reproducible Demo

  • yarn && yarn run flow
    You'll see a Flow type error

Activity

  1. react-native-bot commented on Nov 4, 2018

    @react-native-bot
    Collaborator

    Can you run react-native info and edit your issue to include these results under the Environment section?

    If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

  2. elicwhite commented on Nov 4, 2018

    @elicwhite
    Contributor

    Trying to fix this here: #22048

  3. exced commented on Nov 4, 2018

    @exced
    ContributorAuthor

    Sorry for the duplicate

  4. elicwhite commented on Nov 4, 2018

    @elicwhite
    Contributor

    No worries. This issue caused me to take that report more seriously. Thanks for posting. :-)

  5. added a commit that references this issue on Nov 30, 2018
  6. locked as resolved and limited conversation to collaborators on Nov 4, 2019
  7. added
    Resolution: Locked
    on Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Locked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions