I made a repository showing the issue here (ts-node 7.0.0, typescript 2.9.2): https://github.com/dcodeIO/ts-node-issue
git clone https://github.com/dcodeIO/ts-node-issue
cd ts-node-issue
npm install
Essentially, when running the program the first time, or when not editing src/index.ts, everything works fine, but once src/index.ts is edited, some type definitions fail to resolve.
npm testsrc/index.ts, i.e. by adding another newlinenpm test, errors with:TSError: 脭驴禄 Unable to compile TypeScript:
src/index.ts(2,1): error TS2552: Cannot find name 'test1'. Did you mean 'test'?
Does not happen with ts-node 6 and it appears that it also doesn't happen if files: true is specified (but tsconfig.json doesn't use files here).
Possibly related: https://github.com/TypeStrong/ts-node/commit/33cb1b5faecaa652b70fe97cb3665de7d42565c2#commitcomment-29585194
Super interesting, thanks! I'll need to make some time to look into it 馃憤
Fixed with 8.0 - I believe you are correct, it was an issue around caching.
Most helpful comment
Super interesting, thanks! I'll need to make some time to look into it 馃憤