bee-js icon indicating copy to clipboard operation
bee-js copied to clipboard

tsconfig moduleResolution nodenext - error TS7016: Could not find a declaration file

Open Cafe137 opened this issue 3 years ago • 1 comments

I started a new TS project, installed @ethersphere/bee-js 5.0.0, using node v16.16.0 and npm 8.11.0

package.json#types looks good, points to the correct d.ts file.

Yet I receive this error:

index.ts:1:21 - error TS7016: Could not find a declaration file for module '@ethersphere/bee-js'. '/Users/aron/Code/safe-upload/node_modules/@ethersphere/bee-js/dist/cjs/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/ethersphere__bee-js` if it exists or add a new declaration (.d.ts) file containing `declare module '@ethersphere/bee-js';`

Switching moduleResolution to node fixes it.

Cafe137 avatar Aug 11 '22 09:08 Cafe137

image

Because the dts files this library provided are not valid under NodeNext.

They should have .js extension names.

Jack-Works avatar Aug 27 '22 03:08 Jack-Works