ERROR in changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core
See original GitHub issueBug Report
Ionic version: “@ionic/angular”: “^4.4.2” node 12.3.1
Current behavior: When activating ivy compiler ionic fails to compile with the following message:
ERROR in changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core
Expected behavior: Doesn’t fail to compile
Steps to reproduce:
ionic start ionic-angular-ivy blank --type=angular
add this to your tsconfig.json
"angularCompilerOptions": {
"enableIvy": true
}
then call
ng update @angular/cli @angular/core --force
finally build the empty project
ng build
Related code:
Here’s a github link to a sample project ready to fail:
https://github.com/plchampigny/ionic-angular-ivy
Other information:
I do think the problem comes from this file:
https://github.com/ionic-team/ionic/blob/9030dcc111cc6486d22b45852a9906d18fa51f0c/angular/src/directives/proxies.ts since it’s one of the only usage from changeDetection within ionic and you aren’t using the values from the ChangeDetectionStrategy enum.
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0 (C:\Users\Cactus\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.800.0
@angular-devkit/schematics : 7.3.9
@angular/cli : 8.0.0
@ionic/angular-toolkit : 1.5.1
System:
NodeJS : v12.3.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Added a PR to backport this fix on the branch 0.18.x used by the current version of @ionic/core: https://github.com/ionic-team/stencil/pull/1578
After digging more, I think the problem come from stencil code generation. I’ll create a PR on their side and link it here