Random Error in typescript while compiling angular 5 project

I am working on an angular 5 project which has a component called jform. When I do "ng serve" command The following errors comes randomly. Means it sometimes comes and sometimes doesn't come.

        src/app/jform/jform.component.ts(178,2): error TS1005: ',' expected.
        src/app/jform/jform.component.ts(178,185): error TS1005: ')' expected.
        src/app/jform/jform.component.ts(207,18): error TS1005: ',' expected.

Here is my source code which gives this errors, Line no 8 :

                  import { TabsComponent } from '../tabs/tabs.component';

Line no 178 :

            this.objectProps = Object.keys(res['com'][element]['schema']
            ['properties']).map(prop => { return Object.assign({}, 
             { key: prop} , res['com'][element]['schema']['properties'][prop]);});

Line No 207 :

                  for(let prop of Object.keys(res['com']['schema']
               ['hidden_properties'])) {
                 formGroup[prop] = new FormControl(res['com']['schema']['hidden_properties'][prop].value || '', this.mapValidators(res['com']['schema']['hidden_properties'][prop].validation));
                    }

This is angular version I am using :

         Angular CLI: 1.7.1
         Node: 8.9.2 
         OS: win32 ia32
         Angular: 5.2.6

         @angular/cdk: 5.2.3
         @angular/cli: 1.7.1
         @angular/material: 5.2.3
         @angular-devkit/build-optimizer: 0.3.2
         @angular-devkit/core: 0.3.2
         @angular-devkit/schematics: 0.3.2
         @ngtools/json-schema: 1.2.0
         @ngtools/webpack: 1.10.1
         @schematics/angular: 0.3.2
         @schematics/package-update: 0.3.2
         typescript: 2.4.2 
         webpack: 3.11.0

Is it due to my setup or prob in the code? kindly help me.

Update: The only workaround I use is to just add space or remove space from the jform.component.ts file and compile again and the error went away.


我经常不得不重新启动我的编译器,然后再次运行。

链接地址: http://www.djcxy.com/p/35384.html

上一篇: java在服务器上并行运行服务

下一篇: 在编译angular 5项目时在打字稿中出现随机错误