Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BleedingDev opened this issue Nov 23, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@BleedingDev
Copy link

BleedingDev commented Nov 23, 2024

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 BleedingDev added the bug Something isn't working label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant