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

Installing solid-js breaks Svelte components when imported using TypeScript #4226

Closed
1 task
mayank99 opened this issue Aug 10, 2022 · 3 comments
Closed
1 task
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@mayank99
Copy link
Contributor

mayank99 commented Aug 10, 2022

What version of astro are you using?

1.0.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

WIndows

Describe the Bug

Installing solid-js (even without @astrojs/solid-js) shows the following error in a svelte component when imported in another svelte component using <script lang="ts">.

Type '{}' is not assignable to type 'IntrinsicAttributes & Test__SvelteComponent_'.
  Type '{}' is missing the following properties from type 'Test__SvelteComponent_': $set, $on, $destroy, $$prop_def, and 5 more.ts(2322)

Link to Minimal Reproducible Example

https://github.com/mayank99/astro-svelte-solid-error

Participation

  • I am willing to submit a pull request for this issue.
@FredKSchott FredKSchott added - P3: minor bug An edge case that only affects very specific usage (priority) s1-small labels Aug 10, 2022
@FredKSchott
Copy link
Member

@Princesseuh any idea what could be causing this?

@Princesseuh
Copy link
Member

Investigated this, it's an issue in their tooling. I'm not quite sure exactly why it happens, but you can solve it by using their new TS output by setting svelte.plugin.svelte.useNewTransformation to true!

They are planning to switch to the new transformation as default soon (see sveltejs/language-tools#1552). Until then, we can document it, I'll make an issue / PR on docs

Thank you for reporting the issue @mayank99!

@dummdidumm
Copy link

The problem is that Solid uses JSX, and our (soon old) transformation for proper intellisense also uses JSX under the hood, but the JSX type definitions clash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants