wyw-in-js icon indicating copy to clipboard operation
wyw-in-js copied to clipboard

Could not find a declaration file for module 'debug'

Open eKazim opened this issue 9 months ago • 0 comments

Environment

  • wyw-in-js version: 0.5.3
  • custom processor: linaria
  • Bundler (+ version): TS 5.4.5
  • Node.js version: 20.10.0
  • OS: Windows 10

Description

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

[email protected]
@linaria/[email protected]
@linaria/[email protected]

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'.

eKazim avatar May 17 '24 14:05 eKazim