You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ tsc
main.ts:1:24 - error TS7016: Could not find a declaration file for module 'ngrok'. '.../node_modules/ngrok/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/ngrok` if it exists or add a new declaration (.d.ts) file containing `declare module 'ngrok';`
1 import * as ngrok from 'ngrok';
~~~~~~~
Found 1 error in main.ts:1
Additional context
My intent in this example is to import ngrok using require, and this is what's happening, but typescript doesn't seem to pick up the .d.ts file.
Typescripts esm support is not without controversies. One of them is that they are more strict about the location of .d.ts files: microsoft/TypeScript#49160 . The most straightforward solution seems to be renaming ngrok.d.ts to index.d.ts, but there might be better ways I am not aware of.
The text was updated successfully, but these errors were encountered:
Describe the bug
Getting
when trying to import in a project with
moduleResolution: node16
.To Reproduce
package.json
tsconfig.json
main.ts
and then run:
Output I get:
Additional context
My intent in this example is to import ngrok using require, and this is what's happening, but typescript doesn't seem to pick up the
.d.ts
file.Typescripts esm support is not without controversies. One of them is that they are more strict about the location of
.d.ts
files: microsoft/TypeScript#49160 . The most straightforward solution seems to be renamingngrok.d.ts
toindex.d.ts
, but there might be better ways I am not aware of.The text was updated successfully, but these errors were encountered: