partytown icon indicating copy to clipboard operation
partytown copied to clipboard

[🐞] Partytown React component doesn't allow Readonly<URL> as input

Open BleedingDev opened this issue 1 year ago • 0 comments

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

  1. Add @builder.io/party into project
  2. Use Partytown React component
  3. Pass into resolveUrl function that has url: Readonly<URL>
  4. Observe Typescript failure

Browser Info

Compile time

Additional Information

No response

BleedingDev avatar Nov 23 '24 17:11 BleedingDev