Skip to content

SharedWorker constructor does not accept URLΒ #43689

@johannesf95

Description

@johannesf95

Bug Report

πŸ”Ž Search Terms

SharedWorker constructor, Worker URL

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

new SharedWorker(new URL(""));

πŸ™ Actual behavior

SharedWorker constructor only accepts string but not URL.

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

πŸ™‚ Expected behavior

SharedWorker constructor should accept string or URL like Worker 28397

Since webpack changed its supported syntax for Worker initialization to pass a URL, which also applies to SharedWorker, this missing type became more relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions