lucide
lucide copied to clipboard
Package Setup Issues in `lucide-vue-next` Leading to Module Resolution Errors
Package
- [ ] lucide
- [ ] lucide-angular
- [ ] lucide-flutter
- [ ] lucide-preact
- [ ] lucide-react
- [ ] lucide-react-native
- [ ] lucide-solid
- [ ] lucide-svelte
- [ ] lucide-vue
- [x] lucide-vue-next
- [ ] Figma plugin
- [ ] source/main
- [ ] other/not relevant
Version
latest
Can you reproduce this in the latest version?
- [X] Yes
- [ ] No
Browser
- [ ] Chrome/Chromium
- [ ] Firefox
- [ ] Safari
- [ ] Edge
- [ ] iOS Safari
- [ ] Opera
- [X] Other/not relevant
Operating system
- [ ] Windows
- [ ] Linux
- [ ] macOS
- [X] Other/not relevant
Description
We're encountering an issue where the lucide-vue-next
package seems not to be properly configured, resulting in module resolution errors. This issue has been observed when attempting to import the package, as shown in the error message below:
Error: Cannot find module '/Users/christian/Workspace/ark-ui/node_modules/lucide-vue-next/dist/esm'
Additionally, upon reviewing the package.json
for lucide-vue-next
, numerous warnings and suggestions have been identified, which might be contributing to this problem. Here is a screenshot of the linting output:
Could we look into improving the package setup to prevent such issues? Suggestions and contributions to resolve these warnings are also welcome.
Steps to reproduce
Go to https://publint.dev/[email protected] and check warnings.
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.)
Thanks for reporting will check these issues!
I am having the same issue. I am trying to write Stories for my components library using Histoire which uses vite.js and the reported error is thrown. This basically prevents me from either writing Stories/Documentation or from using these icons.
through some debugging, I found that if the file node_modules/lucide-vue-next/dist/esm/lucide-vue-next.js
would be renamed to index.js
(node_modules/lucide-vue-next/dist/esm/index.js
) then it works just fine.
To fix this problem so that I could write Stories/Documentations I had to change the alias in the Vite build to pass the full path of node_modules.
That way it worked:
import type { UserConfig } from 'vite'
const viteConfig: UserConfig = {
resolve: {
alias: {
'lucide-vue-next': resolve(__dirname, 'node_modules/lucide-vue-next/dist/cjs/lucide-vue-next.js'),
},
},
}