Skip to content

createRequireFromPath does not support directories with a trailing slash #27527

Description

@MylesBorins

Follow up from e5c8be2

TL;DR

createRequireFromPath('/path/to/dir') has unexpected behavior as it is treated as a file not a directory... createRequireFromPath('/path/to/dir/') works as expected.

Seems like the only way forward would be to introduce a synchronous file / directory stat... which imho is undesirable but I totally see why this creates unexpected behavior.

/cc @BridgeAR @addaleax @devsnek

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions