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

[Bug]: Newly created svelte projects depending on svelte@3.58.0 have type errors #21884

Open
kasperpeulen opened this issue Apr 3, 2023 · 3 comments

Comments

@kasperpeulen
Copy link
Contributor

Describe the bug

Newly created svelte projects have type errors:

Type 'typeof Button__SvelteComponent_' is not assignable to type 'ComponentType<{ primary?: boolean | undefined; backgroundColor?: string | undefined; size?: "small" | "medium" | "large" | undefined; label?: string | undefined; }, any>'.
  Types of parameters 'options' and 'options' are incompatible.
    Type 'ComponentConstructorOptions<{ primary?: boolean | undefined; backgroundColor?: string | undefined; size?: "small" | "medium" | "large" | undefined; label?: string | undefined; }>' is not assignable to type 'Svelte2TsxComponentConstructorParameters<{ primary?: boolean | undefined; backgroundColor?: string | undefined; size?: "small" | "medium" | "large" | undefined; label?: string | undefined; }>'.
      Types of property 'target' are incompatible.
        Type 'Element | ShadowRoot | Document' is not assignable to type 'Element | ShadowRoot'.
          Type 'Document' is not assignable to type 'Element | ShadowRoot'.
            Type 'Document' is missing the following properties from type 'ShadowRoot': delegatesFocus, host, mode, slotAssignment, innerHTML

The problem occurs because svelte changed the component type in v3.58.0:
sveltejs/svelte@d49b568

But the autogenerated types from svelte files are not (yet) matching that.

To Reproduce

No response

System

No response

Additional context

No response

@shilman
Copy link
Member

shilman commented Apr 4, 2023

Do we need to open an issue on Svelte @kasperpeulen ? Or is there anything we can do on our side?

@kasperpeulen
Copy link
Contributor Author

kasperpeulen commented Apr 4, 2023

@shilman I think this issue is solved upstream, but it is not yet released:
sveltejs/language-tools#1968

Let's wait for a release to verify.

@CarlAmbroselli
Copy link

@kasperpeulen This has merged, but the issue still persists unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Development

No branches or pull requests

4 participants