Skip to content

Path.relative breaks for paths that differ by trailing separator in v23.0.0 #55424

Closed as not planned
@vzaidman

Description

Version

v23.0.0

Platform

23.6.0 Darwin Kernel Version 23.6.0 arm64

What steps will reproduce the bug?

$ nvm use v22.10.0
$ node
> require('path').relative('/root', '/root/')
''

$ nvm use 23 
$ node      
> require('path').relative('/root', '/root/')
'../root/'

How often does it reproduce? Is there a required condition?

Consistent

What is the expected behavior? Why is that the expected behavior?

require('path').relative('/root', '/root/') should return '' like in previous versions of node

What do you see instead?

require('path').relative('/root', '/root/') returns '../root/'

Additional information

Reproduces on Window and Ubuntu.

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions