Skip to content

createRequireFromPath does not support directories with a trailing slash #27527

@MylesBorins

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

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