nstudio / nativescript-checkbox

NativeScript plugin for checkbox UI component
Other
119 stars 56 forks source link

TypeError: Class constructor BaseValueAccessor cannot be invoked without 'new' #138

Closed madmas closed 3 years ago

madmas commented 3 years ago

Hi, while trying to use version 2.0.2 in my app upgraded to NS7 / Angular 10, I get this exception:

JS: ERROR Error: Uncaught (in promise): TypeError: Class constructor BaseValueAccessor cannot be invoked without 'new'
JS: TypeError: Class constructor BaseValueAccessor cannot be invoked without 'new'
JS:     at new CheckedValueAccessor (file: node_modules/@nstudio/nativescript-checkbox/angular/index.js:30:0)
JS:     at NodeInjectorFactory.CheckedValueAccessor_Factory [as factory] (file: node_modules/@nstudio/nativescript-checkbox/angular/index.js:49:70)
JS:     at getNodeInjectable (file: node_modules/@angular/core/fesm2015/core.js:4184:0)
JS:     at searchTokensOnInjector (file: node_modules/@angular/core/fesm2015/core.js:4123:0)
JS:     at getOrCreateInjectable (file: node_modules/@angular/core/fesm2015/core.js:4043:0)
JS:     at ɵɵdirectiveInject (file: node_modules/@angular/core/fesm2015/core.js:14651:0)
JS:     at ɵɵinject (file: node_modules/@angular/core/fesm2015/core.js:903:0)
JS:     at factory (file: node_modules/@angular/core/fesm2015/core.js:11381:0)

The markup code I use is

<CheckBox #termsAndConditions 
                      text=""
                      checked="false" 
                      class="terms-text" 
                      fillColor="#E09DE0"
                      onCheckColor="#ffffff" 
                      row="0" 
                      col="0" 
                      [(ngModel)]="checkTerms"></CheckBox>

Versions I use:

Angular (all): "~10.1.5",
"@nativescript/angular": "~10.1.5",
"@nativescript/core": "~7.0.0",

According to some SO threads like this it looks like a transpiling / target problem, but I haven't figured out how to fix that.

Can you help?

madmas commented 3 years ago

Hi, it looks like this issue came from leftovers in my ngcc.config.js and are gone now.