Closed unlight closed 7 years ago
In trace mode, I do not see message that lib.dom.d.ts
is loaded by TranspilingLanguageService
Like
[DEBUG] TranspilingLanguageService - Pulling file into memory...
@unlight thanks very much for testing out our new TypeScript support.
Your assumption is correct in that you should see a Pulling file into memory
message. Take Stryker itself as an example:
[2017-09-25 22:48:40.943] [DEBUG] TranspilingLanguageService - Resolving lib file lib.es5.d.ts to C:\z\github\stryker-mutator\stryker\node_modules\typescript\lib\lib.es5.d.ts
[2017-09-25 22:48:40.943] [DEBUG] TranspilingLanguageService - Pulling file into memory: lib.es5.d.ts
[2017-09-25 22:48:40.962] [DEBUG] TranspilingLanguageService - Resolving lib file lib.es2015.promise.d.ts to C:\z\github\stryker-mutator\stryker\node_modules\typescript\lib\lib.es2015.promise.d.ts
[2017-09-25 22:48:40.963] [DEBUG] TranspilingLanguageService - Pulling file into memory: lib.es2015.promise.d.ts
Do you see any lib files at all?
Could you run in debug once more and look at the top for "[DEBUG] Stryker - Using config:"
. There you should also see your typescript config (read using the stryker-typescript ConfigEditor plugin). Could you verify that the lib file is displayed there?
Finally: what versions are you using for typescript and stryker?
Versions:
stryker@0.10.3
stryker-typescript@0.0.2
typescript@2.5.2
I see only this typescript related definition files:
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.core.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.collection.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.generator.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.promise.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.iterable.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.symbol.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.proxy.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.reflect.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts
[DEBUG] TranspilingLanguageService - [39mPulling file into memory: C:/xxx/node_modules/typescript/lib/lib.es5.d.ts
No esnext
which is specified in tsconfig
.
But es2015 was specified explicitly in one of the my spec file by triple comment reference
/// <reference path="../../../node_modules/typescript/lib/lib.es2015.d.ts" />
This pushed me to an idea, and finally I was able to solve it by creating empty ts file with content:
/// <reference path="../node_modules/typescript/lib/lib.dom.d.ts" />
/// <reference path="../node_modules/typescript/lib/lib.esnext.d.ts" />
But initial run still fails for me, but for another reason.
@unlight ok, so the finger clearly points to Stryker not loading lib
files correctly. I tried to reproduce the problem in this small sample: https://github.com/nicojs/stryker-typescript-issue394
I did come across an other bug #396 , but other than that the lib files seems to be loaded fine.
Could you try out this small sample and try to reproduce the problem there?
I've just tried and issue is not reproducible there, esnext definition is loading ok. I will continue investigation in my project.
Figure out the problem.
Need remove all 'path' triple reference <reference path="node_modules/typescript/lib/lib.es2015.d.ts"
due to <reference no-default-lib="true"/>
it prevents loading what is defined in tsconfig.lib
@unlight ok, cool you found the problem. Just to be clear, you had <reference no-default-lib="true"/>
somewhere in your code? If so, how could typescript itself compile?
Are you now able to run stryker on typescript code? Or is there some other issue your running into?
I had several references to 'lib.es2015' in my code. 'lib.es2015' contains 'reference no-default-lib' directive. I suspect that it was the reason.
tsconfig
part of stryker.conf
When I run
tsc
Everything compiled ok, without errors.When
stryker run
it produce a tons of errors:In
tsconfig
lib dom, esnext is specified, but looks like stryker ignores it.