0

My Angular 11 application triggers this warning in console:

Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'? core.js:27937

Is there a way to trace that warning to the point in my code that might be raising it (assuming the origin is really in my code)?

VBobCat
  • 2,527
  • 4
  • 29
  • 56

1 Answers1

1

Not sure what you mean by console. If you're using Jest and its outputting that message to the console, you can use jest-fail-on-console to have the warnings give you better error messages:

https://github.com/ValentinH/jest-fail-on-console#readme

failOnConsole({
  shouldFailOnWarn: true,
});
Casey Plummer
  • 2,629
  • 23
  • 20
  • 1
    Thanks. Not using jest. I guess it was a quirk from that version, because it disappeared when I upgraded to Angular 12. – VBobCat Dec 29 '22 at 00:34