Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Error with ngMock / angular-mock since version 1.3.12  #11303

@richard-lopes

Description

@richard-lopes

I tried to move angular-mock past 1.3.12 and I couldn't so far.
The other packages are sitting at 1.3.14 at the moment but if I run my tests (Karma + Jasmine) with a recent with a recent version of angular-mock I get something like this:

Error: [$injector:modulerr] Failed to instantiate module ng due to:
Error: [$injector:modulerr] Failed to instantiate module ngLocale due to:
RangeError: Maximum call stack size exceeded
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
    at Function.angular.injector.$$annotate (http://localhost:9876/base/tmp/lib/angular-mocks.js:2147:36)
http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=ngLocale&p1=RangeError%3A%20Maximum%20call%20stack%20size%20exceeded%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)
    at REGEX_STRING_REGEXP (http://localhost:9876/base/tmp/lib/angular.js:63:12)
    at http://localhost:9876/base/tmp/lib/angular.js:4120:15
    at forEach (http://localhost:9876/base/tmp/lib/angular.js:323:20)
    at loadModules (http://localhost:9876/base/tmp/lib/angular.js:4081:5)
    at http://localhost:9876/base/tmp/lib/angular.js:4098:40
    at forEach (http://localhost:9876/base/tmp/lib/angular.js:323:20)
    at loadModules (http://localhost:9876/base/tmp/lib/angular.js:4081:5)
    at Object.createInjector [as injector] (http://localhost:9876/base/tmp/lib/angular.js:4007:11)
    at Object.workFn (http://localhost:9876/base/tmp/tools/angular-mocks.js:2354:52)
http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=ng&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20ngLocale%20due%20to%3A%0ARangeError%3A%20Maximum%20call%20stack%20size%20exceeded%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0A%20%20%20%20at%20Function.angular.injector.%24%24annotate%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular-mocks.js%3A2147%3A36)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.14%2F%24injector%2Fmodulerr%3Fp0%3DngLocale%26p1%3DRangeError%253A%2520Maximum%2520call%2520stack%2520size%2520exceeded%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%250A%2520%2520%2520%2520at%2520Function.angular.injector.%2524%2524annotate%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Ftmp%252Flib%252Fangular-mocks.js%253A2147%253A36)%0A%20%20%20%20at%20REGEX_STRING_REGEXP%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A63%3A12)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A4120%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A4081%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A4098%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A323%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A4081%3A5)%0A%20%20%20%20at%20Object.createInjector%20%5Bas%20injector%5D%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Flib%2Fangular.js%3A4007%3A11)%0A%20%20%20%20at%20Object.workFn%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Ftmp%2Ftools%2Fangular-mocks.js%3A2354%3A52)%0A%20%20%20%20at%20attemptSync%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fnode_modules%2Fjasmine-core%2Flib%2Fjasmine-core%2Fjasmine.js%3A1741%3A24)
    at REGEX_STRING_REGEXP (http://localhost:9876/base/tmp/lib/angular.js:63:12)
    at http://localhost:9876/base/tmp/lib/angular.js:4120:15
    at forEach (http://localhost:9876/base/tmp/lib/angular.js:323:20)
    at loadModules (http://localhost:9876/base/tmp/lib/angular.js:4081:5)
    at Object.createInjector [as injector] (http://localhost:9876/base/tmp/lib/angular.js:4007:11)
    at Object.workFn (http://localhost:9876/base/tmp/tools/angular-mocks.js:2354:52)

The code added between 1.3.11 and 1.3.12 is related to those annotated functions. It seems it is entering some sort of infinite loop as soon as is loads the ng module.

Any idea ? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions