-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Svelte for VS Code extension crushes react project #1149
Comments
Did you enable the TypeScript plugin of the extension (https://github.com/sveltejs/language-tools/tree/master/packages/svelte-vscode#svelteenable-ts-plugin)? If yes, that could be the reason (though I need to investigate why this happens and fix that) |
I tried with the plugin enabled and disabled. Both ways don't work, unfortunately. |
Is it every react project, or only specific ones? Which version of "Svelte for VS Code" is installed? I can't reproduce this. |
I tried different react projects, the errors appear in every project. |
From the errors it sounds like the ambient definitions of |
I'm having the same problem in a monorepo containing svelte and react projects. |
It backs to work if I disable the Svelte extension. Looks that somehow the extension is injecting the |
Could you check if the problem persists with the latest release of the Svelte extension (105.4.2) ? |
@dummdidumm still happening here |
Having the same issue in an Nx monorepo with svelte and react. Enabling svelte plugin (with/out ts support) breaks "react", same as @maykefreitas ☝🏼 |
Wondering if the tsserver reuses the same language service for both the react project and the svelte project. Can you try if adding a Here's an example {
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
|
Goal: Get rid of a tsx-style transformation and simplify transformations along the way #1077 #1256 #1149 Advantages: - no messing with projects who use JSX for some other reason and then have conflicting JSX definitions - TS control flow easier to keep flowing - overall easier transformations of Svelte specific syntax like await, each etc. - better type inference in some cases, for example around svelte:component This includes: - rewriting the html2jsx part of svelte2tsx - adjusting the language server to the new transformation - adding a toggle to language-server and vs code extension to turn on the new transformation. Default "off" for now, with the plan to switch it to "on" and then removing the old transformation altogether - ensuring tests run with both new and old transformation - adjusting the TypeScript plugin. It uses the new transformation already now since it's not easily possible to add an option (on/off). Should be low-impact since TS doesn't need to know much about the contents of a Svelte file, only its public API Look at the PR of this commit to see more explanations with some of the entry points of the new transformation.
The most recent versions of the extension and
Please try it out, more info in #1352 |
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:
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

System (please complete the following information):
The text was updated successfully, but these errors were encountered: