-
-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Description
This is a very weird bug which took me hours to whittle down to a minimal example, so I hope it's of use. Steps to reproduce:
-
git clone https://github.com/pelotom/fork-ts-checker-bug cd fork-ts-checker-bug npm install npm start
- Everything should compile fine on the first run. Now open the file
foo.ts
, add a newline or some other innocuous change, and save it. - Now there is an error in a completely different file:
ERROR in /Users/tom/code/fork-ts-checker-bug/index.ts (1,25): Cannot find module 'moment'.
What the hey!?
Some observations:
- Undoing the change has no effect; the error remains. However modifying
index.ts
and saving it fixes the problem somehow. - Killing the watch process and restarting fixes the problem; first builds always work
- The problem only occurs with the
no-unused-variable
TSLint rule enabled - If another library besides
moment
is imported inindex.ts
, it may or may not exhibit the problem. For example,typestyle
exhibits the problem butrxjs
doesn't. I'm not sure what the commonality is among packages that run afoul of this.
axxag, gejgalis, univerio, skyway777, buffaybu and 24 morereedesler, danielfalk, Timur2915 and kolyamba2105
Metadata
Metadata
Assignees
Labels
No labels