Skip to content

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

Open
@BleedingDev

Description

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions