I have been working on an application where I receive an object from an HTTP request and convert it into an iterable array. During development mode, the code sometimes runs without any issues but occasionally gives me random errors like the one below. However, when I try to run 'ng build --prod', I consistently encounter the same error which has become a roadblock for me.
Can anyone point out what I might be missing?
Object.keys(res['com'][element]['schema']['properties']).forEach(inputKey => {
this.newfdata[element]['properties'].push(res['com'][element]['schema']['properties'][inputKey]);
}
// this is line no. 223
this.objectProps = Object.keys(res['com'][element]['schema']['properties']).map(prop => {
return Object.assign({}, { key: prop} , res['com'][element]['schema']['properties'][prop]);
// this is line no. 228
});
The mentioned lines are resulting in the error message below:
ERROR in src/app/shared/layout/add.component.ts(223,5): error TS1005: ',' expected.
src/app/shared/layout/add.component.ts(228,11): error TS1005: ')' expected.
Your assistance with this issue would be greatly appreciated as it is preventing the app from entering production mode entirely.
Thank you in advance.