-
Notifications
You must be signed in to change notification settings - Fork 117
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
v0.2.6 completely breaks Prettier in Svelte Projects #148
Comments
Hey! This will likely be impossible to debug without a reproduction project to test in. This does not happen to me in a freshly set up SvelteKit project and I tried best replicating your set up (node, pnpm, prettier version, Ventura, etc…). Can you create a new project and let me know what you see there? Also is there any project/repo this happens in that you can share? Even a stripped down version that still produces problems? It would also be beneficial to have a list of your installed VS Code plugins and settings relating to formatting. I always have trouble with pnpm and the prettier extension not working at all unless I use "Format Code (Forced)" and I'm not sure if that's what you're doing here or not. I suspect it has something to do with the new config resolution for TypeScript and ESM configs but I can't figure out why that would be a problem. If it's using ~90–100% of the CPU that makes it sound like it's stuck in a loop for some reason. |
Basically, what I want to be able to do is reproduce this locally and then profile the process in Instruments and tracking syscalls using That'll at least point me in a direction as to what might be going on. |
Hi 😀 https://github.com/n00ki/kickoff-sveltekit Which is a starter template I made. The issue is reproduced when working on it. Hope it's good enough🙏🏼 |
That's helpful! I left the project open in a Svelte file for almost an hour and merely typing in the editor makes vS Code stutter now. Not even related to saving the files which is quite odd. I'll see if I can figure out what's going on. |
On my side, going from When I run
(I'm also in a sveltekit project) |
Can confirm the same for 0.2.7 version — Svelte prettifying is really slow |
@thecrypticace any chance you were able to find the root cause for this behavior? |
Thanks for the issue! Downgrading back to 0.2.5 temporarily solved the extremely slow prettifying in my svelte project. |
@n00ki Not yet. The slowness I ended up experiencing appeared to have been a weird interaction with the Prettier VS Code extension, an invalid config file, and copilot. As soon as I disabled co-pilot the typing speed returned to normal. So I think it's unrelated. |
Hey just a note on this — we were able to reproduce this issue and were able to verify that this occurs with the VS Code Prettier extension with nothing else enabled (using Extension Bisect). Disabling the At this point we need to do some more debugging to see if we can figure out what's causing this. |
Hey! So we think we've got a fix for this. I've merged this in #153 and it's available to test via our insiders build:
Could you give it a test and report back? You'll need to close/reopen VS Code after installing it so the prettier extension doesn't have the old version in memory. |
Gave it a go, looks great! seems like you did it :) |
Node version:
18.12.1
Package Manager:
pnpm 8.2.0
VSCode version:
1.77.1
prettier
version:2.8.7
prettier-plugin-tailwindcss
version:0.2.6
tailwindcss
version:3.3.1
OS:
macOS Ventura 13.3
Hi :)
I'm dealing with a significant performance issue across all of my SvelteKit projects, after upgrading
prettier-plugin-tailwindcss
tov0.2.6
.Upon launch, CPU climbs to 100% and higher, which makes coding basically impossible. it seems like the app shell is doing fine, yet the code editing experience (auto-completion, formatting, saving, etc.) completely breaks.
After running the Bisect tool, as the CPU hogging process is
Code Helper (Plugin)
(orExtensionHost
), It seems like Prettier is the root cause.It's important to mention that I didn't make any changes in VSCode/prettier configurations.
removing
prettier-plugin-tailwindcss
entirely from the prettier plugins array / downgrading it to 0.2.5 fixed the issue immediately.I've attached some screenshots of the activity monitor, VSCode Process Explorer, ps aux, and messages displayed when attempting to save Svelte / TS files (while saving is prevented, and vscode is basically stuck).
Any ideas? 💡
The text was updated successfully, but these errors were encountered: