Skip to content
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

URL: new URL('#...') difference between Chrome and Node #39102

Closed
guybedford opened this issue Jun 20, 2021 · 3 comments
Closed

URL: new URL('#...') difference between Chrome and Node #39102

guybedford opened this issue Jun 20, 2021 · 3 comments

Comments

@guybedford
Copy link
Contributor

guybedford commented Jun 20, 2021

  • Version: 16
  • Platform: Windows
  • Subsystem: URL

What steps will reproduce the bug?

Run the following:

new URL('#test')

Throws: ERR_INVALID_URL

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

Always

What is the expected behavior?

Not sure what is expected by the spec, but the same code in Chrome always parses as an about:blank URL. And this difference actually affects real universal code patterns

@targos
Copy link
Member

targos commented Jun 20, 2021

whatwg-url also throws for this URL.

@RaisinTen
Copy link
Contributor

Node.js is doing the right thing and Chrome is not. See: whatwg/url#539.

@guybedford
Copy link
Contributor Author

Thanks, this is an important one to follup up with on Chrome actually.

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

3 participants