lucide icon indicating copy to clipboard operation
lucide copied to clipboard

Too many requests in dev mode

Open PeterlitsZo opened this issue 11 months ago • 5 comments

Package

  • [ ] lucide
  • [ ] lucide-angular
  • [ ] lucide-flutter
  • [ ] lucide-preact
  • [ ] lucide-react
  • [ ] lucide-react-native
  • [X] lucide-solid
  • [ ] lucide-svelte
  • [ ] lucide-vue
  • [ ] lucide-vue-next
  • [ ] Figma plugin
  • [ ] source/main
  • [ ] other/not relevant

Version

^0.336.0

Browser

  • [X] Chrome/Chromium
  • [X] Firefox
  • [ ] Safari
  • [ ] Edge
  • [ ] iOS Safari
  • [ ] Opera
  • [ ] Other/not relevant

Operating system

  • [ ] Windows
  • [X] Linux
  • [X] macOS
  • [ ] Other/not relevant

Description

When I am using lucide-solid in my SolidStart project, I find that in the dev mode, it will request too many requests and let me must wait for > 1min. (I develop it in the remote machine, which is an Linux machine, and using Chrome / Arc / Firefox to interact with the project)

截屏2024-02-29 19 06 56

Here is the section of package.json of lucide-solid:

{
  // ...
  "exports": {
    ".": {
      "types": "./dist/types/lucide-solid.d.ts",
      "solid": "./dist/source/lucide-solid.js",
      "import": "./dist/esm/lucide-solid.js",
      "browser": "./dist/esm/lucide-solid.js",
      "require": "./dist/cjs/lucide-solid.js",
      "node": "./dist/cjs/lucide-solid.js"
    }
  }
  // ...
}

It looks like it just using the "./dist/source/lucide-solid.js", which has bad performance when in development.

Steps to reproduce

  • Using lucide-solid in any solid project.
  • Import it like import { CheckCircle, Circle, Trash2 } from 'lucide-solid';.
  • Run it in development mode.

Here I am using the SolidStart framework and Bun so you can:

bunx create-solid@latest
bun install
bun run dev

Then you can install the lucide-solid and import it in any file.

Checklist

  • [X] I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)

PeterlitsZo avatar Feb 29 '24 11:02 PeterlitsZo

Possibly related to https://github.com/vitejs/vite/issues/8237

jguddas avatar Feb 29 '24 11:02 jguddas

Just a question: could we import a icon by import ChevronDownSquare from "lucide-solid/chevron-down-square"?

PeterlitsZo avatar Mar 02 '24 14:03 PeterlitsZo

@PeterlitsZo Hmm not possible at the moment. Solid currently requires to have a bundled ESM file.

ericfennis avatar Mar 06 '24 20:03 ericfennis

any news on this? having the same problem.

mifreudenthaler avatar Jun 07 '24 14:06 mifreudenthaler

I have the same problem. As soon I load one icon all icons are loaded in dev mode and my computer starts to struggle.

floratmin avatar Aug 15 '24 05:08 floratmin