Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Can't enable plugin - Maximum call stack size exceeded #200

Closed
fracz opened this issue Dec 18, 2014 · 24 comments
Closed

Can't enable plugin - Maximum call stack size exceeded #200

fracz opened this issue Dec 18, 2014 · 24 comments

Comments

@fracz
Copy link

fracz commented Dec 18, 2014

When trying to enable the plugin via "Enable" checkbox, my website stops working with the following error in the console.

Uncaught Error: [$injector:modulerr] Failed to instantiate module ngHintModules due to:
RangeError: Maximum call stack size exceeded
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1220:21)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1271:5)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1274:7
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1272:21)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1274:7
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1272:21)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1274:7
http://errors.angularjs.org/1.3.6/$injector/modulerr?p0=ngHintModules&p1=Ra…nsion%3A%2F%2Fighdmehidhipcmcojjgiloacoafjmpfk%2Fdist%2Fhint.js%3A1274%3A7
@waratah
Copy link

waratah commented Jan 8, 2015

Happens to me as well. Similar to issue 157

@arecaps
Copy link

arecaps commented Feb 24, 2015

Same here

@dceddia
Copy link

dceddia commented Mar 3, 2015

I get the same thing. There's a question on SO about this too: http://stackoverflow.com/questions/27393367/chrome-extension-hint-js-nghintmodules

I tried reverting to 0.4.3 and it does seem to fix this problem.

@eseceve
Copy link

eseceve commented May 15, 2015

I get the same problem

@SomeKittens
Copy link
Member

Can anyone get this to repro with a minimal app?

@gbrennon
Copy link

same here...

@Zeouterlimits
Copy link

Yeah, I am having the same issue.

Error:
Failed to instantiate module ngHintModules due to:
RangeError: Maximum call stack size exceeded
at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1441:26)

Chrome Version: 44.0.2403.125 (64-bit)
AngularJS Batarang: 0.8.5

@SomeKittens
Copy link
Member

Posting another "Me too" won't help us find the issue. If you're encountering this, please try to recreate it with a minimal app.

@sjurba
Copy link

sjurba commented Oct 8, 2015

This answer suggests it has something to do with module loading: http://stackoverflow.com/a/27399197

Perhaps something to look into?

@gary-b
Copy link
Contributor

gary-b commented Oct 8, 2015

I spent a bit of time trying to repro this based on that answer, unfortunately without success..

@sjurba
Copy link

sjurba commented Oct 8, 2015

How about if you create a cyclic dependency? Or perhaps you simply need a large application with a large number of dependencies...

Here is a current stacktrace from the latest batarang version:

Uncaught Error: [$injector:modulerr] Failed to instantiate module ngHintModules due to:
RangeError: Maximum call stack size exceeded
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1455:21)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1506:5)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1509:7
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1507:21)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1509:7
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1507:21)

This points to this function (hint.js:1505):

var storeUsedModules = module.exports = function(module, modules){
  if(module) {
    storeDependencies(module);
    module.requires.forEach(function(modName) {
      var mod = modules[modName];
      storeUsedModules(mod, modules);
    });
  }
};

As you can see it is recurses through all modules and their dependencies. Looks like a good place to start. But it also seems this problem is within angular-hint?

@SomeKittens
Copy link
Member

Having trouble reproducing this, but what @sjurba wrote very much makes sense. Would be very easy to trigger an overflow there.

@SomeKittens
Copy link
Member

Theoretical fix in above PR.

@sjurba
Copy link

sjurba commented Oct 9, 2015

If you can build a version of batarang for me, I can try to test it and see if the fix helped.

@SomeKittens
Copy link
Member

(assuming you have gulp installed globally)

mkdir angular && cd angular
git clone git@github.com:angular/batarang.git
git clone git@github.com:angular/angular-hint.git
cd angular-hint
git checkout track-seen-modules && git pull origin track-seen-modules
npm i && gulp browserify
npm link
cd ../batarang
npm link angular-hint
npm i && gulp browserify

^ Should get you a Batarang repo pointed to the other branch of Angular hint.

Open Chrome Extensions, select Load Unpacked Extension browse to the directory you created above, pick batarang. You'll probably see a load of warnings, ignore them. Disable regular Batarang so there's no confusion/conflicts.

You should be running the dev version of Batarang in regular Chrome.

@sjurba
Copy link

sjurba commented Oct 9, 2015

Super. The fix worked. Also double checked by disabling the specific fix by removing: seen.push(name);, in which case the stack overflow is back.

@SomeKittens
Copy link
Member

Fixed in angular/angular-hint@c91ef9e

@gary-b
Copy link
Contributor

gary-b commented Oct 9, 2015

Great stuff SomeKittens and sjurba.

@bopm
Copy link

bopm commented Nov 30, 2015

Why there is no release for that fix? It's still not working in 0.10.1 as there is still old angular-hint in it.

@typehorror
Copy link

@bopm The plugin is last Update is October 1, 2015. The fix hasn't been deployed yet to the google extension store.

Since the changes are on master, you might be able to follow the guidelines given by SomeKittens, but ignore the line checking out the experimental branch:

git checkout track-seen-modules && git pull origin track-seen-modules

@SomeKittens
Copy link
Member

@Debrice We're working on a release as I'm typing this.

@evanjmg
Copy link

evanjmg commented Mar 17, 2016

Is this released yet? I'm still getting maximum call stack exceeded error with the latest build, but the performance metrics seem to continue to work.

@SomeKittens
Copy link
Member

@evanjmg What version are you running? 0.10 or 0.4? (Batarang "Stable" isn't affiliated with this project).

@evanjmg
Copy link

evanjmg commented Mar 18, 2016

AngularJS Batarang 0.10.7 - developer mode - followed your commands.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests