2

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.

1 Answer 1

1

I often have to restart my compiler and then everything works again.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes it is also one workaround. But I am tensed due to reoccurance of this issue. As I am going ahead in development, I am concerned that other places don't create this same error.
is there any mistake in my code? today this error is coming 33% of the time I compile.
So it is a random behavior of typescript build compiler? It happens in development mode as well as production mode. But once the app is running and live, it is not causing any problems.
I think, but I can't answer you 100%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.