Skip to content

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

Closed
ruizdiazever opened this issue Jan 8, 2025 · 11 comments
Closed

Very slow in dev mode #12928

ruizdiazever opened this issue Jan 8, 2025 · 11 comments
Labels
needs repro Issue needs a reproduction

Comments

@ruizdiazever
Copy link

ruizdiazever commented Jan 8, 2025

Astro Info

Astro                    v5.1.3
Node                     v22.9.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/svelte
                         @astrojs/sitemap
                         @astrojs/mdx
                         @astrojs/tailwind
                         paraglide
                         astro-icon

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?

  • macOS Sequoia 15.2 (local)
  • WSL in Windows

Image example:

Screenshot_2024-12-17_at_18 15 54

What's the expected result?

Normal refresh timing in dev mode

Link to minimal example

https://github.com/ruizdiazever/astro-svelte-demo

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 8, 2025
@ematipico
Copy link
Member

It seems that the cause of the slowness is Header. I couldn't go deeper than that. If you can't provide a minimal reproduction, I suggest asking for support on our Discord server.

@ematipico ematipico added the needs repro Issue needs a reproduction label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Hello @ruizdiazever. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Jan 8, 2025
@ruizdiazever
Copy link
Author

@ascorbic
Copy link
Contributor

ascorbic commented Jan 8, 2025

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.

@ruizdiazever
Copy link
Author

I will work on it, thanks.

@ruizdiazever
Copy link
Author

Setting everything to client:only fix the problem, ruizdiazever/astro-svelte-demo@4f6829d

I rule out that it is something related to shadcn-svelte or Svelte since another person has the same problem without using Svelte

@ascorbic
Copy link
Contributor

ascorbic commented Jan 9, 2025

Are you importing any big UI or icon libraries? Modules that use barrel file exports can cause this sort of slowdown.

@ruizdiazever
Copy link
Author

The problem only appears in Astro 5, in 4 this did not happen with the same UI and icon libraries!

@ascorbic
Copy link
Contributor

ascorbic commented Jan 9, 2025

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2025
@ruizdiazever
Copy link
Author

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://stackblitz.com/~/github.com/raau-design/minimal?file=src/components/header/toggleDarkMode.svelte

https://github.com/raau-design/minimal/blob/main/src/components/header/toggleDarkMode.svelte

@kaishin
Copy link

kaishin commented Mar 22, 2025

Thanks @ruizdiazever, your solution worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue needs a reproduction
Projects
None yet
Development

No branches or pull requests

4 participants