question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Svelte for VS Code extension crushes react project

See original GitHub issue

Describe the bug After installing the Svelte for VS Code extension in my editor to work on a svelte project, a different project written in react and typescript completely crushes and throws ts error all over the place:

Type '() => svelte.JSX.Element' is not assignable to type 'FC<{}>'.
  Type 'Element' is not assignable to type 'ReactElement<any, any> | null'.
    Type 'Element' is missing the following properties from type 'ReactElement<any, any>': type, props, key

literally every .tsx file throw errors, the project worked flawlessly before installing the svelte extension.

The only way I found so far, is to disable the extension every time I’m not working on a svelte project, which sucks, you know.

To Reproduce Steps to reproduce the behavior:

Open a react-ts project with the svelte extension in VSCode i guess.

Expected behavior svelte extension doesn’t influence non-svelte projects

Screenshots image

image

System (please complete the following information):

  • OS: MAC OS
  • IDE: VSCode
  • Plugin/Package: “Svelte for VSCode”

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
sudomfcommented, Sep 30, 2021

I’m having the same problem in a monorepo containing svelte and react projects.

0reactions
dummdidummcommented, Jan 30, 2022

The most recent versions of the extension and svelte-check contain a new transformation behind a flag which should fix this issue. You can try out the new transformation using

  • “Svelte for VS Code” version 105.11.1 and setting svelte.plugin.svelte.useNewTransformation to true
  • svelte-check version 2.4.0 with the --use-new-transformation flag.

Please try it out, more info in #1352

Read more comments on GitHub >

github_iconTop Results From Across the Web

Svelte for VS Code - Visual Studio Marketplace
Svelte for VS Code. Provides syntax highlighting and rich intellisense for Svelte components in VS Code, using the svelte language server.
Read more >
Must Have VS Code Extension for Working with SvelteKit
SvelteKit is one of the best frameworks out there, and working with it just got much much easier!Check out this new extension in...
Read more >
Top 10 Best VS Code Extensions for Svelte Developers
1. Svelte for VS Code · 2. Svelte Intellisense · 3. Svelte 3 Snippets · 4. Tailwind CSS IntelliSense · 5. Better Comments...
Read more >
How To Use Svelte With Tailwind CSS | by Samuele
As I said a few days ago I decided to focus on some more complex projects. The first is “GEST — Dashboard”. Bad...
Read more >
Svelte vs Vue - Which one to choose? - ButterCMS
For a long time, there were only three contenders for the title of “the best JavaScript UI framework” - React, Vue, and Angular....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found