Built-in URL is not compatible with @types/node
URL
#59996
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
⚙ Compilation target
es6
⚙ Library
lib.dom.d.ts
Missing / Incorrect Definition
I get an error after updating from
5.5.4
->5.6.2
because the builtin URL is not longer compatible with node's URL. This is problematic because the builtin URL and node's URL are often used interchangeably.Even if their types aren't strictly the same, I'd normally expect there not to be an error when using one in place of the other.
In the following example, the line where we use
new URL(origin)
has an error becauseimport("url")
doesn't match the builtinURL
.Perhaps the typing of
@types/node
need to be updated?Sample Code
Documentation Link
This was probably introduces as part of the strict iterator checks
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#strict-builtin-iterator-checks-(and---strictbuiltiniteratorreturn)
The text was updated successfully, but these errors were encountered: