question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
plchampignycommented, May 29, 2019

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

3reactions
plchampignycommented, May 29, 2019

After digging more, I think the problem come from stencil code generation. I’ll create a PR on their side and link it here

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR in changeDetection must be a member of ... - GitHub
ERROR in changeDetection must be a member of ChangeDetectionStrategy enum from @angular/core. Expected behavior: Doesn't fail to compile.
Read more >
angular - ChangeDetectorRef does not exist in my component
It's a local variable within constructor until you add a accessor like public / private. import { Component, OnInit, ChangeDetectionStrategy ...
Read more >
ChangeDetectionStrategy - Angular
The strategy that the default change detector uses to detect changes. When set, takes effect the next time change detection is triggered. See...
Read more >
A Change Detection Strategy Revealing Mistakes in Your Code
In this article, we look into how the OnPush strategy affects Angular's change detection mechanism and which pitfalls we should avoid at all ......
Read more >
Change Detection Strategy Appears To Override The ...
Ben Nadel explores the interplay between a component's change detection strategy and the injected ChangeDetectorRef in Angular 2 RC 3.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found