Skip to content

Unable to use URI.resolve from root if joined path is absolute #15423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
colin-grant-work opened this issue Apr 8, 2025 · 0 comments
Open

Comments

@colin-grant-work
Copy link
Contributor

Bug Description:

Calling something like URI.fromFilePath('/').resolve('/path/with/initial/separator') fails with an error If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//"). (Note that URI.resolve behaves like Node's path.join, not Node's path.resolve, which is URI.resolveToAbsolute).

Originally addressed in #15331 but that fix caused problems in webviews. See #15416 and #15420.

Steps to Reproduce:

  1. URI.fromFilePath('/initial/segments/').resolve('/path/with/initial/separator')
  2. Observe no error.
  3. URI.fromFilePath('/').resolve('/path/with/initial/separator')
  4. Observe an error.

Additional Information

  • Operating System: Mac OS Sequoia
  • Theia Version:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant