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

Cannot read property 'firstCreatePass' of null

Open dtslvr opened this issue 4 years ago • 10 comments

We still have an issue after upgrading ngx-custom-validators from 8.0.0 to 10.0.0 using Angular 10.

HTML

<input
  json
  [(ngModel)]="settings.elements">
</input>

Error in console

zone-evergreen.js:171 Uncaught TypeError: Cannot read property 'firstCreatePass' of null
    at providersResolver (core.js:18748)
    at Object.definition.providersResolver (core.js:19000)
    at resolveDirectives (core.js:7986)
    at elementStartFirstCreatePass (core.js:13939)
    at Module.ɵɵelementStart (core.js:13977)
    at SettingsComponent_ng_container_0_Template (settings.html:70)
    at executeTemplate (core.js:7447)
    at renderView (core.js:7256)
    at TemplateRef.createEmbeddedView (core.js:10162)
    at ViewContainerRef.createEmbeddedView (core.js:10231)

Environment information

  • OS: macOS Catalina
  • Angular Version: 10.0.6
  • Typescript version: 3.9.7
  • npm version: 6.14.8
  • Node Version: 14.15.0

dtslvr avatar Nov 09 '20 14:11 dtslvr

<input type="text" required [rangeLength]="[0, 6]" class="form-control" [(ngModel)]="..." (ngModelChange)="..." #unitNameModel="ngModel" id="..." name="..." autocomplete="off">

core.js:4442 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'firstCreatePass' of null
TypeError: Cannot read property 'firstCreatePass' of null
    at providersResolver (core.js:18748)
    at Object.definition.providersResolver (core.js:19000)
    at resolveDirectives (core.js:8004)
    at elementStartFirstCreatePass (core.js:14749)
    at Module.ɵɵelementStart (core.js:14787)
    at ......_Template (…s.component.html:19)
    at executeTemplate (core.js:7457)
    at renderView (core.js:7264)
    at renderComponent (core.js:8520)
    at renderChildComponents (core.js:7138)
    at resolvePromise (zone-evergreen.js:798)
    at resolvePromise (zone-evergreen.js:750)
    at zone-evergreen.js:860
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:27492)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)
    at Zone.runTask (zone-evergreen.js:167)
    at drainMicroTaskQueue (zone-evergreen.js:569)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:484)
    at invokeTask (zone-evergreen.js:1621)

Windows 10 Angular: 10.2.3 Typescript: 4.0.5 Node: 14.15.0 Angular/cli: 10.2.0

sannyjacobsson avatar Nov 11 '20 09:11 sannyjacobsson

Same issue in Angular 11.0.1. Downgrading ngx-custom-validators to 8.0.0 still works as a workaround.

coder925 avatar Nov 13 '20 10:11 coder925

Using ngx-custom-validators:11.0.1 together with Angular 11 (11.0.9) seems to work. Can someone confirm?

dtslvr avatar Jan 20 '21 09:01 dtslvr

I don't seem to be getting this error anymore.

matiasah avatar Jan 20 '21 23:01 matiasah

It worked (on ver 11.0.1) briefly for Angular 11.0.9, but now with Angular 11.1.x, it's broken again (with the error from this issue). Additionally during npm install in an Angular 11.1.2 project that uses ngx-custom-validators, it produces

  • (minor) [email protected] requires a peer of @angular/core@~11.0.0
  • (not sure what the ramifications are) @angular/[email protected] requires a peer of zone.js@~0.10.3 but none is installed, as it relies on that version of angular and has zone.js@~0.10.3 in peerDependencies, while newer Angular sits already on zone.js@~0.11.3

Not work with Angular: 11.2.0 and ngx-custom-validators:11.0.1 . I have to downgrade ngx-custom-validators to 8.0.0

rodrigueaf avatar Feb 20 '21 18:02 rodrigueaf

It worked (on ver 11.0.1) briefly for Angular 11.0.9, but now with Angular 11.1.x, it's broken again (with the error from this issue)

Also broken in Angular 12.0.1.

dtslvr avatar May 26 '21 07:05 dtslvr

Of course it is.

I seem to get this error only if I bind min or minDate property to input, removing binding works. Not sure what's the problem.

tamirazrab avatar Oct 11 '21 02:10 tamirazrab

Hi, although I'm not using ngx-custom-validators, I managed to get a similar error. I fixed the error just by adding the following tp tsconfig.json:

"paths": {
  "@angular/*": ["./node_modules/@angular/*"]
 },

to the compilerOptions section

scaljeri avatar Jan 26 '23 13:01 scaljeri