ericclemmons/click-to-component

TypeScript error "Could not find a declaration file for module"

danitatt opened this issue · 1 comments

Describe the bug
Could not find a declaration file for module 'click-to-react-component'. This error appears if tsconfig.json is set to "strict": true

To Reproduce
Steps to reproduce the behavior:

  1. Init new project with Vite (React + typescript + SWC) npm create vite@latest
  2. Install click-to-react-component npm i click-to-react-component
  3. Import click-to-react-component in main.tsx
  4. See typescript error

Expected behavior
No typescript error in VS Code.

Screenshots
Снимок экрана 2024-05-15 в 23 42 41

Error from TypeScript

Could not find a declaration file for module 'click-to-react-component'. '/Users/danitatt/Work/nnp/app/node_modules/click-to-react-component/src/index.js' implicitly has an 'any' type. There are types at '/Users/danitatt/Work/nnp/app/node_modules/click-to-react-component/src/types.d.ts', but this result could not be resolved when respecting package.json "exports". The 'click-to-react-component' library may need to update its package.json or typings.

Thanks for the great tool!

Seeing the same problem, could be worked around with // @ts-expect-error but would be nice to get this fixed :)