Skip to content

Worker constructor does not accept URL #28397

Closed
@TimvdLippe

Description

@TimvdLippe

TypeScript Version: 3.2.0-dev.201xxxxx

Search Terms: worker new url, worker constructor

Code

new Worker(new URL(""))

Expected behavior: Compiles fine, as it is valid per the spec

Actual behavior:

[ts] Argument of type 'URL' is not assignable to parameter of type 'string'.

Playground Link: http://www.typescriptlang.org/play/#src=new%20Worker(new%20URL(%22%22))%3B

Related Issues: #15338, #15246 and was recently updated in #28136 as well

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions