Chrome extension hint.js & ngHintModules

后端 未结 6 793
梦谈多话
梦谈多话 2020-12-08 18:37

Our angular app sometime does not load on chrome canary (Version 41.0.2237.0 canary (64-bit)) saying

Failed to instantiate module ngHintModules due to

6条回答
  •  庸人自扰
    2020-12-08 18:40

    You don't need to disable Angular batarang; just do the following:

    1. Open the developer tools and navigate to the hint.js file (the one that is triggering the stack overflow)
    2. Go to line 453 add add a breakpoint
    3. reload the app, and when it hits the breakpoint just comment it out (setupModuleLoader(window)) and click continue
    4. It will still throw an exception, (Uncaught ReferenceError: angular is not defined) but you will be able to run batarang

    I know it's not the best solution, but that's the quickest thing I could find without going too deep into the problem

    Update:

    Checking more to what is happening I noticed that the problem happens when we have define multiple modules and we are adding the same dependencies for all of them.

    for example:

    angular.module("app", ["moduleB", "moduleC"]);
    angular.module("moduleB", ["moduleC"]);
    

    When I define the moduleB without passing the same deps with it's parent module, then there is no stack overflow.

    angular.module("moduleB", []);
    

提交回复
热议问题