SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
Whit4D

Astro + resolvePackageJsonExports: false

I have a Solid project that I am moving to Astro to get access to SSR.
It uses lucide-solid for icons.
Astro was giving me grief about that lucide-solid import saying:
Could not find a declaration file for module 'lucide-solid'. '/Users/anthony/project/node_modules/.pnpm/lucide-solid@0.274.0_solid-js@1.7.11/node_modules/lucide-solid/dist/esm/lucide-solid.js' implicitly has an 'any' type.
  There are types at '/Users/anthony/project/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.ts(7016)

I figured out that I was able to resolve this issue by adding "resolvePackageJsonExports": false, to tsconfig compilerOptions. However, I am a little concerned about the implications of this.

Is there a bug in lucide-solid's
package.json
? I see Astro is using bundler for moduleResolution while a vanilla Solid project was using node.
Or... Is this potentially a bug with Astro?
Was this page helpful?