Ts-node: Type resolution or caching issue

Created on 4 Jul 2018  路  2Comments  路  Source: TypeStrong/ts-node

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.

  1. npm test
  2. Edit src/index.ts, i.e. by adding another newline
  3. npm 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

bug

Most helpful comment

Super interesting, thanks! I'll need to make some time to look into it 馃憤

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huan picture huan  路  3Comments

joshua-tj picture joshua-tj  路  3Comments

dakom picture dakom  路  3Comments

max-block picture max-block  路  4Comments

sodiumjoe picture sodiumjoe  路  4Comments