Anber / wyw-in-js

MIT License
191 stars 8 forks source link

Could not find a declaration file for module 'debug' #86

Open eKazim opened 1 month ago

eKazim commented 1 month ago

Environment

Description

I'm compiling es-modules by Typescript (tsc) in project with React-components which uses linaria:

typescript@5.4.5
@linaria/core@6.2.0
@linaria/react@6.2.1

But I have an error when I try to compile:

../../node_modules/@wyw-in-js/shared/types/logger.d.ts:1:26 - error TS7016: Could not find a declaration file for module 'debug'. 'C://myProject/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

1 import genericDebug from 'debug';
                           ~~~~~~~

It seems that @wyw-in-js/shared need to add @types/debug to its dependencies in package.json?

For now I fix the issue by npm i -D @types/debug, but I don't think I should have to install the types in my consumer project since I do not directly use package 'debug'.