Hi guys ,
maybe you can help me to investigate this issue …
when I’m running my build like :
ionic cordova run android --release -> have no issues and all good
ionic cordova run android --release – prod I got this error and I try to find out what is that :
TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (native)
at Object.__extends (/Users/x/projects/y/node_modules/tslib/tslib.js:64:9)
at /Users/x/projects/y/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:115:17
at /Users/x/projects/y/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:314:6
at Object.defineProperty.value (/Users/x/projects/y/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:3:17)
at Object. (/Users/x/projects/y/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:9:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
Nope … still looking for solution and a way to investigate it.
this is what is going on … --prod --verbose :
[18:05:46] ngc started …
TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf ()
at Object.__extends (/Users/x/projects/x/node_modules/tslib/tslib.js:64:9)
at /Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:115:17
at /Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:314:6
at /Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:3:17
at Object. (/Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[DEBUG] TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf ()
at Object.__extends (/Users/x/projects/x/node_modules/tslib/tslib.js:64:9)
at
/Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:115:17
at
/Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:314:6
at
/Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:3:17
at Object.
(/Users/x/projects/x/node_modules/@angular/compiler-cli/src/ngtsc/indexer/src/template.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Facing the same error on ‘ionic cordova build android --prod’. Tried removing node_modules folder and npm install but nothing is working. Any solutions?
Yes. In my case in my package.json class all angular version was 5.2.11 but @angular/compiler-cli version was 8. So I changed it to 5.2.11, deleted node_modules and did npm install. It worked.