augury icon indicating copy to clipboard operation
augury copied to clipboard

"Unhandled Promise rejection: Cannot read property 'injector' of null" CONSOLE ERROR JUST AFTER AUGURY INSTALLATION

Open megamind2301 opened this issue 9 years ago • 8 comments

Augury version (required):1.6.0 Angular version (required):4.0.1 Date:19/4/2017 OS:Ubuntu

Description of issue: Augury is not working due to this error in console. This error comes only after I add augury to the list of extensions.

image

megamind2301 avatar Apr 19 '17 12:04 megamind2301

@Megamind2301 Is there code available that I can recreate this with? The error is a little bewildering because I believe this means getAllAngularRootElements() is returning a null root, which shouldn't happen as far as I know.

stevenkampen avatar Apr 20 '17 09:04 stevenkampen

IT IS confusing.

  • Everything works fine even with this error.
  • When I uninstall augury, this error disappears.
  • Augury is not getting receiving the boot file I guess.

I need to fix this urgently. Any workaround would work just fine (if there is any).

megamind2301 avatar Apr 20 '17 10:04 megamind2301

@Megamind2301 If you can recreate it in a simple form and publish some code I'll look at it ASAP. Otherwise I'm going to be shooting in the dark trying to make it happen.

stevenkampen avatar Apr 20 '17 11:04 stevenkampen

I have the same error. project is angular4 with --prod and --aot (from agnular/cli). But the error comes not from Zone.js but from polyfills.js

laserus avatar Apr 23 '17 22:04 laserus

@Megamind2301 @laserus @cpeisert Ok, I've found an issue where if the application is calling enableProdMode, then Augury will still try to initialize (which it usually wouldn't, because it can't debug an application in production mode). Can you see if this is what's happening in your cases? There may be a separate AoT issue which I'm looking into now.

stevenkampen avatar Apr 24 '17 09:04 stevenkampen

@stevenkampen for non-prod build the Augury works fine. Probably, you need some message into console that catches this exception.

laserus avatar Apr 24 '17 09:04 laserus

@laserus There is a message usually, but something has changed in Angular so that our logic to read that production/debug flag is now incorrect. We're chasing up a fix for it though so it should be back to normal behaviour soon.

stevenkampen avatar Apr 24 '17 10:04 stevenkampen

@stevenkampen The Augury error is no longer appearing in production mode. Thank you for your help.

cpeisert avatar Apr 29 '17 16:04 cpeisert