Skip to content
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

Missing types for lucide-solid #1431

Closed
oMatheuss opened this issue Jul 14, 2023 · 2 comments
Closed

Missing types for lucide-solid #1431

oMatheuss opened this issue Jul 14, 2023 · 2 comments
Labels
🐛 bug Something isn't working

Comments

@oMatheuss
Copy link

oMatheuss commented Jul 14, 2023

Prerequisites

  • Version: ^0.260.0
  • Are you running from source/main: no
  • Are you using a released build: yes
  • Operating system: Windows 11
  • Bits: 64 bits

Step to reproduce

  • create a solid project with vite npm create vite@latest.
  • install lucide-solid with npm install lucide-solid
  • try to use any icon import { ServerCrash } from 'lucide-solid';

Actual behavior

even though it works vscode gives the error on the import and the intellisense doesnt work.

message

Could not find a declaration file for module 'lucide-solid'. '.../node_modules/lucide-solid/dist/esm/lucide-solid.js' implicitly has an 'any' type.
There are types at '.../node_modules/lucide-solid/dist/types/lucide-solid.d.ts', but this result could not be resolved when respecting package.json "exports". The 'lucide-solid' library may need to update its package.json or typings.
@oMatheuss oMatheuss added the 🐛 bug Something isn't working label Jul 14, 2023
@oMatheuss
Copy link
Author

oMatheuss commented Jul 14, 2023

I solved this problem, it was a problem related to typescript version (4.9.4 -> 5.0.2). The solution was just add the types to the exports section on package.json on the lucide-solid package. reference.

"exports": {
  ".": {
    "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",
    "types": "./dist/types/lucide-solid.d.ts"
  }
}

But in the end this doesn't help anything, because later I discovered that on dev mode, both with the vite initializer and the solid start (npm init solid@latest), the treeshaking is not working, which leads to it shipping all icons. I dont know if theres a solution for this, maybe if it is possible to make imports unitary like lucide-solid/ServerCrash, but I think the problem lives in the solid related packages.

@oMatheuss
Copy link
Author

duplicated #823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant