Skip to content

Svelte gets very slow on hard refresh [dev env] #15603

@elansx

Description

@elansx

Describe the bug

I have noticed that svelte slows down significantly when hard refresh occurs when using any icon library (like lucide/svelte or tabler/icons-svelte), in development.

Up to few seconds to load the page, hot reloads seems to be working just fine.

It seems that app tries to load all icons at once every time.

Currently I'm bypassing this issue by making alias directly to node_modules, so i can import like this:
'@icons/arrow-left.svelte' and this solves the issue.

At first I though this was lucide issue, but once I installed tabler icons that was sure thing that this is svelte issue, because it loads even slower with tabler as they have much more icons available.

Reproduction

  1. Import icons via { YourIcon } from '@lucide/svelte' in <script> tags
  2. Render icons in your html
  3. Make hard refresh in browser.

Logs

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
    Memory: 5.84 GB / 15.94 GB
  Binaries:
    Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions