Skip to content

Updating to Angular 11

New Discussion
Ted Herrlich
Ted Herrlich asked on Jan 6, 2021 12:41 PM

I’ve followed the Upgrade directions to go from 10 to 11 and my App is working.  However, I am getting a pair of compiler errors:

Generating browser application bundles (phase: additional asset processing)…
Error: node_modules/@infragistics/igniteui-angular/lib/grids/common/pipes.d.ts:97:5 – error TS2416: Property ‘transform’ in type ‘IgxDatePipeComponent’ is not assignable to the same property in base type ‘DatePipe’.
Type ‘(value: any, locale: string) => string’ is not assignable to type ‘{ (value: string | number | Date, format?: string, timezone?: string, locale?: string): string; (value: null, format?: string, timezone?: string, locale?
: string): null; (value: string | number | Date, format?: string, timezone?: string, locale?: string): string; }’.
Type ‘string’ is not assignable to type ‘null’.

97 transform(value: any, locale: string): string;
~~~~~~~~~
node_modules/@infragistics/igniteui-angular/lib/grids/common/pipes.d.ts:107:5 – error TS2416: Property ‘transform’ in type ‘IgxDecimalPipeComponent’ is not assignable to the same property in base type ‘DecimalPipe’.
Type ‘(value: any, locale: string) => string’ is not assignable to type ‘{ (value: string | number, digitsInfo?: string, locale?: string): string; (value: null, digitsInfo?: string, locale?: string): null; (value: string | num
ber, digitsInfo?: string, locale?: string): string; }’.
Type ‘string’ is not assignable to type ‘null’.

107 transform(value: any, locale: string): string;
~~~~~~~~~

√ Browser application bundle generation complete.

Any ideas why this should be happening?  I am using the Pipe in several places, part of using the Ignite Autocomplete, but the error is only showing up for the Date and Decimal Pipes.  Is there a fix?  My ‘ng update’ says everything is updated.

Sign In to post a reply

Replies

  • 0
    Tihomir Tonev
    Tihomir Tonev answered on Jan 6, 2021 12:41 PM

    Hello Ted,

    Thank you for posting on our forums.

    I believe this is caused by the stricter typing in common pipes in angular 11(link) where overloading is used.

    I would suggest adding further overloads for the transform method to match the data types you have used.

    e.g:

    transform(DateValue: null | undefined, args?: string): null;
    transform(DateValue: number, args: string): string | null {
      …
    }

    Should you need further assistance, please let me know.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Ted Herrlich
Favorites
0
Replies
1
Created On
Jan 06, 2021
Last Post
5 years, 5 months ago

Suggested Discussions

Created by

Created on

Jan 6, 2021 12:41 PM

Last activity on

Feb 18, 2026 8:16 AM