Search code examples
cssangularsasscompiler-errorscodekit

Codekit fails to compile main.ts and app.component.spec.ts in angular v5 project


I am running Angular 5.1.0 through terminal and have a folder set up for sass in /src/scss, I am using codekit to compile the sass.

Everything was running fine and was compiling with no errors until the last couple of saves, now when I save my css codekit tells me that main.ts and app.component.spec.ts failed to compile.

Is this a known issue with running codekit and angular together? If not, is there an easy way to fix this, it's really bugging me, can I choose to ignore these files through codekit and continue as normal?

Codekit statements below:

/src/app/app.component.spec.ts

TypeScript: node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts(12,32): error TS2304: Cannot find name 'Iterable'. node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,16): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(32,16): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts(14,48): error TS2304: Cannot find name 'Iterable'. node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts(22,18): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'. node_modules/rxjs/Observable.d.ts(58,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here. node_modules/rxjs/Observable.d.ts(73,59): error TS2693: 'Promise' only refers to a type, but is being used as a value here.

/src/main.ts

TypeScript: node_modules/@angular/common/src/directives/ng_class.d.ts(48,34): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/aot/compiler.d.ts(71,32): error TS2304: Cannot find name 'Map'. node_modules/@angular/compiler/src/compile_metadata.d.ts(322,20): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/compile_metadata.d.ts(324,28): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/compile_metadata.d.ts(326,15): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/compile_metadata.d.ts(328,23): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/compile_metadata.d.ts(330,17): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/compile_metadata.d.ts(332,25): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/output/output_ast.d.ts(514,63): error TS2304: Cannot find name 'Set'. node_modules/@angular/compiler/src/view_compiler/type_check_compiler.d.ts(29,161): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts(12,32): error TS2304: Cannot find name 'Iterable'. node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,16): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(32,16): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts(14,48): error TS2304: Cannot find name 'Iterable'. node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts(22,18): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'. node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'. node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts(79,33): error TS2304: Cannot find name 'Map'. node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(97,42): error TS2304: Cannot find name 'Map'. node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(11,30): error TS2304: Cannot find name 'Set'. node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(22,30): error TS2304: Cannot find name 'Set'. node_modules/rxjs/Observable.d.ts(58,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here. node_modules/rxjs/Observable.d.ts(73,59): error TS2693: 'Promise' only refers to a type, but is being used as a value here.


Solution

  • Codekit ships with .ts output settings set to es3 and react.js, you have to run through your project and manually update the settings to reflect the project type, in my case this was to "ECMAScript Target Version: ES6" and "JSX Handling: Preserve".