-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Very slow in dev mode #12928
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
Comments
It seems that the cause of the slowness is |
Hello @ruizdiazever. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Could you make the repro more minimal. We really need you to remove things until you can see where the issue disappears, or (better) start from an empty starter and add just the parts needed to reproduce it. As it stands, that site has a lot of stuff in there which make it hard for us to diagnose the source of the issue. |
I will work on it, thanks. |
Setting everything to I rule out that it is something related to shadcn-svelte or Svelte since another person has the same problem without using Svelte |
Are you importing any big UI or icon libraries? Modules that use barrel file exports can cause this sort of slowdown. |
The problem only appears in Astro 5, in 4 this did not happen with the same UI and icon libraries! |
I get that. Astro 5 also upgraded Vite to 6 which changed some things there. We have another issue looking at that. My point is that those kind of big barrel exports are a bad pattern in any case, and will always have a negative effect on Vite, particularly in dev. If that is the case here then it's a simple workaround (use subpath imports) that will avoid the current issue and make it even faster if we get a fix for that too. |
The problem is basically due to how they are importing the Lucide icons (the one that appears in the official documentation), if I do it the way I clarify it does not happen. https://github.com/raau-design/minimal/blob/main/src/components/header/toggleDarkMode.svelte |
Thanks @ruizdiazever, your solution worked for me as well. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Chrome, Safari, Firefox
Describe the Bug
Since my migration to astro 5 I have had a very high slowness in dev mode.
Only happen in dev mode in local, in a container work normal and in build mode too.
Where happen?
Image example:
What's the expected result?
Normal refresh timing in dev mode
Link to minimal example
https://github.com/ruizdiazever/astro-svelte-demo
The text was updated successfully, but these errors were encountered: