ngx-custom-validators
ngx-custom-validators copied to clipboard
Not working when upgrading to Angular 12
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
Made a pull request for this. Tests are passing without problems. https://github.com/jsanta/ngx-custom-validators
`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?
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
it worked here: https://stackoverflow.com/questions/68220000/how-to-fix-ngx-custom-validator-in-angular-12/68746402#68746402