question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Project is loading all icons despite only using two.

See original GitHub issue

Prerequisites

  • Version: 0.91.0
  • Are you running from source/main: Yes
  • Are you using a released build: Yes
  • Operating system: Windows
  • Bits: 64

Step to reproduce

Install package. I installed the Svelte version. I imported ChevronUpDown in one file and Info in another. Upon refreshing the page it takes upwards of 5-8 seconds with HMR. Inside the network tab in my dev tools I can see every icon being retrieved with a 200 success status instead of just the two I am using.

Actual behavior

I would expect it to only load the icons I am using.

Any message or error

(Type here)

Resources

  • Code
//Example of using Info Icon
<script>
import {Info} from "lucide-svelte"
</script>
<label class="form-label" style="grid-area: 3/1/4/5" for="product">
    <span>
        Product:
	<Info size={16} strokeWidth={2} />
    </span>
    <input class="input" type="text" placeholder="EX: CLIPS" name="product" />
</label>
  • Screenshot of network tab image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JustBarntcommented, Oct 22, 2022

@ericfennis I can look into seeing how vite does treeshaking as well, maybe I can find a solution and give you an update.

0reactions
ericfenniscommented, Nov 6, 2022

@JustBarnt Thanks for opening issue in vite repo. The reply in vitejs/vite#10742 by @sapphi-red is the answer for this issue. I can’t affect the way vite is loading the imports in the index file in dev mode. See issue in vitejs/vite#8237.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Icons Imports everything even when included 2 or 3 icons
I found a fix by switching to 3.0.0-Beta1 and including icons like this: import { MdPublic } from 'react-icons/md/index.mjs'; which ...
Read more >
Android App from Library project loading two app icons
When I launch my child app, Eclipse loads onto the device both the library version and the child version, both as fully functioning...
Read more >
How to Fix the Most Annoying Things in Windows - PCMag
In regedit navigate to HKEYCURRENTUSER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3. Double-click on Settings on the right.
Read more >
Material Icons Guide | Google Fonts
An overview of material icons—where to get them and how to integrate them with your projects. What are material icons? Material design system...
Read more >
Font Awesome icons in Vue.js apps: A complete guide
The Font Awesome icon collection is a library of free, easy-to-use icons. In this tutorial, learn to add those icons to your Vue.js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found