ngx-custom-validators icon indicating copy to clipboard operation
ngx-custom-validators copied to clipboard

Not working when upgrading to Angular 12

Open olegkap opened this issue 3 years ago • 4 comments

IMPORTANT: Please be specific with an example. An issue with

Upgrade any application from Angular 11 to Angular 12

Current behavior Fails to compile with following error:

Error: node_modules/ngx-custom-validators/src/app/url/directive.d.ts:8:25 - error TS2694: Namespace '"C:/Projects/***********/ClientApp/node_modules/ngx-custom-validators/node_modules/@angular/core/core"' has no exported member 'ɵɵDirectiveDeclaration'.

Expected/desired behavior

Compile succefully

Environment information

  • OS: Windows 10
  • Angular Version: 12
  • Typescript version: 4.2.4
  • npm version: 6.14.9
  • Node Version: v14.16.0

Other information

olegkap avatar May 18 '21 20:05 olegkap

Made a pull request for this. Tests are passing without problems. https://github.com/jsanta/ngx-custom-validators

jsanta avatar May 25 '21 20:05 jsanta

`Error: node_modules/ngx-custom-validators/node_modules/@angular/forms/forms.d.ts:4283:25 - error TS2694: Namespace '"Projects/node_modules/ngx-custom-validators/node_modules/@an gular/core/core"' has no exported member 'ɵɵDirectiveDeclaration'.

4283 static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<ɵNgNoValidate, "form:not([ngNoForm]):not([ngNativeValidate])", never, {}, {}, never>; ~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/ngx-custom-validators/node_modules/@angular/forms/forms.d.ts:4318:25 - error TS2694: Namespace '"Projects/node_modules/ngx-custom-validators/node_modules/@an gular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

4318 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵNgSelectMultipleOption, [null, null, { optional: true; host: true; }]>; ~~~~~~~~~~~~~~~~~~~~

Error: node_modules/ngx-custom-validators/node_modules/@angular/forms/forms.d.ts:4319:25 - error TS2694: Namespace '"Projects/node_modules/ngx-custom-validators/node_modules/@an gular/core/core"' has no exported member 'ɵɵDirectiveDeclaration'.

4319 static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<ɵNgSelectMultipleOption, "option", never, { "ngValue": "ngValue"; "value": "value"; }, {}, never>; `

I am also facing this problem. How to fix it please?

kuth-chi avatar Jul 02 '21 04:07 kuth-chi

There is a pull request for fixing the problem but It has not been applied for a long time. I created my package to use it

https://www.npmjs.com/package/@narik/custom-validators

abadakhshan avatar Jul 02 '21 07:07 abadakhshan

it worked here: https://stackoverflow.com/questions/68220000/how-to-fix-ngx-custom-validator-in-angular-12/68746402#68746402

davifsroberto avatar Aug 11 '21 17:08 davifsroberto