bun icon indicating copy to clipboard operation
bun copied to clipboard

`parse` does not exist on URL

Open camc314 opened this issue 5 months ago • 2 comments

What version of Bun is running?

1.1.26+0a37423ba

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

access the parse property of URL

What is the expected behavior?

it's typed correctly something like the lib types:

    /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static) */
    parse(url: string | URL, base?: string | URL): URL | null;

What do you see instead?

<file name>:919:5 - error TS2339: Property 'parse' does not exist on type '{ new (url: string | URL, base?: string | URL | undefined): URL; prototype: URL; canParse(url: string | URL, base?: string | undefined): boolean; createObjectURL(obj: Blob | MediaSource): string; revokeObjectURL(url: string): void; }'.

919 URL.parse;

Additional information

This function exists:

bun repl
Welcome to Bun v1.1.26
Type ".help" for more information.
[!] Please note that the REPL implementation is still experimental!
    Don't consider it to be representative of the stability or behavior of Bun overall.
> typeof URL.parse
'function'
> 

camc314 avatar Sep 10 '24 17:09 camc314