Description
I have an app with ts-node
and ts-babel-node
configured (using the register require). When I try to start the app, I get the following error (app specific):
Uncaught exception: TSError: ⨯ Unable to compile TypeScript
.../verification/spec.ts (21,28): Parameter 'state' implicitly has an 'any' type. (7006)
.../verification/spec.ts (28,28): Parameter 'state' implicitly has an 'any' type. (7006)
at getOutput (.../node_modules/ts-node/dist/index.js:169:23)
at Object.compile (.../node_modules/ts-node/dist/index.js:272:19)
at Module.m._compile (.../node_modules/ts-node/dist/index.js:212:49)
at Module._extensions..js (module.js:579:10)
at Object.hook (.../node_modules/ts-babel-node/index.js:52:3)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at require (internal/module.js:20:19)
at Object.<anonymous> (.../verification/index.ts:9:13)
But when I run tsc
, it gives no errors. Also, in VSCode, I see no error when viewing that file.
I managed to see why this was happening and this block caught my attention (
Line 208 in 6748fa3
// Add all files into the file hash.
for (const fileName of config.fileNames) {
if (/\.d\.ts$/.test(fileName)) {
cache.versions[fileName] = 1
}
}
If I remove the condition to only add the .d.ts files into the cache, and run the app, I see no errors. I think this condition is not right, as all the files should go to the cache since they are later used for getScriptFileNames
in the service host (
Line 270 in 6748fa3
I'll try to find a minimal example to repro this since I still don't understand why is this the case, but just filing this issue with a pointer to that suspicious piece in case you maybe know more about it.