You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ng test
30 11 2017 15:18:44.033:ERROR [config]: Invalid config file!
TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'jasminewd2'. (2688)
Cannot find type definition file for 'jquery'. (2688)
Cannot find type definition file for 'lodash'. (2688)
Cannot find type definition file for 'node'. (2688)
Cannot find type definition file for 'q'. (2688)
Cannot find type definition file for 'selenium-webdriver'. (2688)
at getOutput (d:\workspace\smp-sgwt\node_modules\ts-node\src\index.ts:300:15)
at d:\workspace\smp-sgwt\node_modules\ts-node\src\index.ts:330:16
at Object.compile (d:\workspace\smp-sgwt\node_modules\ts-node\src\index.ts:489:17)
at Module.m._compile (d:\workspace\smp-sgwt\node_modules\ts-node\src\index.ts:382:43)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .js] (d:\workspace\smp-sgwt\node_modules\ts-node\src\index.ts:385:12)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.parseConfig (d:\workspace\smp-sgwt\node_modules\karma\lib\config.js:363:22)
at new Server (d:\workspace\smp-sgwt\node_modules\karma\lib\server.js:56:20)
at Promise (d:\workspace\smp-sgwt\node_modules\@angular\cli\tasks\test.js:34:33)
at Class.run (d:\workspace\smp-sgwt\node_modules\@angular\cli\tasks\test.js:15:16)
at Class.run (d:\workspace\smp-sgwt\node_modules\@angular\cli\commands\test.js:104:25)
this is solved with the workaround #4177 which was marked as closed though
Second (unsolved) problem:
afterwards, I get another error:
$ rm -rf node_modules/ts-node
$ ng test
10% building modules 2/2 modules 0 active30 11 2017 15:28:00.084:WARN [karma]: No captured browser, open http://localhost:9876/
30 11 2017 15:28:00.099:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
30 11 2017 15:28:00.101:INFO [launcher]: Launching browser Chrome with unlimited concurrency
30 11 2017 15:28:00.153:INFO [launcher]: Starting browser Chrome
ERROR in d:/workspace/smp-sgwt/src/app/services/column-defs.service.ts (57,11): Type 'Set<{}>' is not an array type.
ERROR in d:/workspace/smp-sgwt/src/app/services/column-defs.service.ts (57,11): Type 'Set<{}>' is not an array type.
30 11 2017 15:28:15.389:ERROR [launcher]: Cannot start Chrome
Ok, I realised there was three configs: src/tsconfig.app.json, and also src/tsconfig.spec.json, and also a tsconfig.json at root.
the target was es5 in src/tsconfig.spec.json. I changed it and it works now. (there is still the first bug though which, if I understand correctly, messes with e2e tests, but I have none yet)
The first problem you present shows Invalid config file!, which makes me believe it was a bad tsconfig file. It seems that other than that finding the right tsconfig where to set options has sorted your problem.
Versions
Repro steps & Observed behavior
First problem (workaroundable):
this is solved with the workaround #4177 which was marked as closed though
Second (unsolved) problem:
afterwards, I get another error:
The incrimated code is:
This should works, as the target in tsconfig is :
"target": "es2015",
and indeed it does work withng serve
orng build
.Desired behavior
This should works, as the target in tsconfig is :
"target": "es2015",
and indeed it does work withng serve
orng build
.It seems that karma is not using the right target as defined in tsconfig.ts
see also #2312
The text was updated successfully, but these errors were encountered: