Skip to content

module.name_mapper doesn't work when pointing to a file within flow-typed #4481

Open
@bjohn465

Description

@bjohn465

In my case, I was using module.name_mapper.extension, but module.name_mapper seemed to work the same.

If I have a .flowconfig like this:

[options]
module.name_mapper.extension='mp3' -> '<PROJECT_ROOT>/flow-typed/mp3-stub.js'

Flow will still error with "Required module not found" when importing an MP3 file. I have a reduced case of this.

When I move mp3-stub.js to a different directory, such as flow-stubs, the "Required module not found" error goes away, as seen in this commit of the reduced case.

If this is intended behavior, it may be worth updating the documentation to mention this restriction. I'd be willing to help with updating the documentation, if needed.

Activity

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions