partytown
partytown copied to clipboard
[🐞] Partytown React component doesn't allow Readonly<URL> as input
Describe the bug
I get Typescript error when I define the function passed into resolveUrl with Readonly<URL>.
Type '(url: Readonly<URL>) => Readonly<URL>' is not assignable to type '(url: URL, location: Location, type: ResolveUrlType) => URL | null | undefined'.
Type 'Readonly<URL>' is not assignable to type 'URL'.
Type 'Readonly<URL>' provides no match for the signature 'new (url: string | URL, base?: string | URL | undefined): URL'.
Reproduction
https://github.com/NaucMeIT/web/blob/e5449239cbfd995dea9749055db6e376c8f28c5c/apps/legacy_nmit/pages/_document.tsx#L57
Steps to reproduce
- Add
@builder.io/partyinto project - Use
PartytownReact component - Pass into
resolveUrlfunction that hasurl: Readonly<URL> - Observe Typescript failure
Browser Info
Compile time
Additional Information
No response