wclr / ts-node-dev

Compiles your TS app and restarts when files are modified.
MIT License
3.42k stars 123 forks source link

Bug -Could not find declaration file, when TS has no errors #217

Open stephanoparaskeva opened 3 years ago

stephanoparaskeva commented 3 years ago
src/config/search_options.ts:1:24 - error TS7016: Could not find a declaration file for module 'typesense'. '/Users/Stephano/Development/code/app/archimedes/node_modules/typesense/lib/Typesense.js' implicitly has an 'any' type.
  Try `npm install @types/typesense` if it exists or add a new declaration (.d.ts) file containing `declare module 'typesense';`

1 import { Client } from 'typesense';
                         ~~~~~~~~~~~

But TypeScript itself shows no errors as I have a declaration file:

Screenshot 2020-10-13 at 21 28 01

ts-node-dev version: "ts-node-dev": "^1.0.0-pre.63",

wclr commented 3 years ago

try --files option. https://github.com/whitecolor/ts-node-dev#issues

soullivaneuh commented 3 years ago

Got the same issue and the --files option indeed solves it.

@whitecolor What is the magic behind? Should not be better to have the same result as compiling typescript (which works without option)? :thinking:

wclr commented 3 years ago

Got the same issue and the --files option indeed solves it.

Another way of compiling is used then and tsc, read ts-node docs if interested. Or read this package docs more carefully.