Skip to content

[0.61.0-rc.0] wrong Flow module name mappers #26233

@thymikee

Description

@thymikee

React Native version:

v0.61.0-rc.0

Steps To Reproduce

  1. npx react-native init --version 0.61.0-rc.0
  2. or react-native upgrade

Describe what you expected to happen:

Flow should see assets as images, but see strings. This is caused by wrong module name mapper config.

Snack, code example, screenshot, or link to a repository:

Code in template/_flowconfig:

module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'

The fix is: <PROJECT_ROOT> -> <PROJECT_ROOT>/node_modules/react-native.

I'd send the fix myself, but I'm short on time now, just wanted to make sure it's noticed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions