DEV Community

Vincent RITHNER
Vincent RITHNER

Posted on

Compilation Issue with Angular 9.1.x

Hi Guys,
I'm facing a very strange issue and I hope you will be able to help to figure out what is causing it.

I have 1 Angular application cloned in 2 different folders on my localhost pc.

each folder get a different branch
I use WinMerge to compare the folders and only code modifications are shown as differences but applications settings (angular.json + Package.json are identical)

One application is compiling with success
The 2nd one gets tons of errors like these ones:

`432 point[1].reduce((comulation, current) => comulation.concat(current), [])
~~~~~~
src/app/core/core.service.ts:277:32 - error TS2339: Property 'rowIndex' does not exist on type 'unknown'.

277 let row = s.rows[c.rowIndex];
~~~~~~~~
src/app/core/core.service.ts:284:44 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Control'.
Type '{}' is missing the following properties from type 'InstructionNoteControl': controlId, name, _type, isInFirstCol, and 16 more.

284 row.columns = row.columns.push(c);
~
src/app/core/core.service.ts:319:18 - error TS2349: This expression is not callable.
Type '{}' has no call signatures.

319 point[1].reduce((comulation, current) => comulation.concat(current), [])
~~~~~~
src/app/core/core.service.ts:841:5 - error TS2322: Type 'unknown[]' is not assignable to type 'number[]'.
Type 'unknown' is not assignable to type 'number'.

841 return arr.toArray();
~~~~~~~~~~~~~~~~~~~~~
src/app/store/reducers/report-manager.reducer.ts:660:45 - error TS2339: Property 'forEach' does not exist on type 'unknown'.

660 state.getIn(['currentReport', 'items']).forEach((page, pageIndex) => {
~~~~~~~
src/app/store/reducers/report-manager.reducer.ts:716:99 - error TS2339: Property 'map' does not exist on type 'unknown'.

716 on(unverifyAllSections, state => state.updateIn(['currentReport', 'items'], pages => ([...pages.map(page => ({
~~~
src/app/store/reducers/report-manager.reducer.ts:763:10 - error TS2339: Property 'columns' does not exist on type 'unknown'.

763 .columns.filter(c => c._type !== ControlModelEnum.DropZone).size;`

I saw on internet lots of posts mentioning the Unknown versus any variable types but why it would work in one application and not in the other one ?

It's like if for one of the application, all "unknown" type are considered as "any" and in the second one, "unknown" are really unknown. As both applications are code identical and with same settings, how on earth is it possible ?

Anyone would have an idea what could couse this kind of behavior ?
Thanks in advance
-Vince

Top comments (0)