Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: Cannot read property 'elementBinders' of undefined" with angular2 and http SFX bundles #3890

Closed
nweedon opened this issue Aug 28, 2015 · 3 comments

Comments

@nweedon
Copy link

nweedon commented Aug 28, 2015

Using: alpha.35
Plnkr: http://plnkr.co/edit/SKDoDfEQJNEhjb1FZYfG?p=preview

Using the following SFX scripts and creating a simple component causes the titular error:
angular2: https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js
http: https://code.angularjs.org/2.0.0-alpha.35/http.sfx.dev.js

Full trace:

EXCEPTION: RangeError: Maximum call stack size exceeded
angular.sfx.dev.js:27039 STACKTRACE:
angular.sfx.dev.js:27039 RangeError: Maximum call stack size exceeded
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
    at assert (http.sfx.dev.js:8075)
angular.sfx.dev.js:27043 EXCEPTION: TypeError: Cannot read property 'elementBinders' of undefined
angular.sfx.dev.js:27039 STACKTRACE:
angular.sfx.dev.js:27039 TypeError: Cannot read property 'elementBinders' of undefined
    at _collectNestedProtoViews (angular.sfx.dev.js:18529)
    at System.register.execute.ProtoViewFactory.createAppProtoViews (angular.sfx.dev.js:18880)
    at angular.sfx.dev.js:35765
    at Zone.run (angular.sfx.dev.js:136)
    at Zone.System.register.execute.NgZone._createInnerZone.zone.fork.fork.$run [as run] (angular.sfx.dev.js:20109)
    at zoneBoundFn (angular.sfx.dev.js:109)
    at lib$es6$promise$$internal$$tryCatch (angular.sfx.dev.js:1359)
    at lib$es6$promise$$internal$$invokeCallback (angular.sfx.dev.js:1371)
    at lib$es6$promise$$internal$$publish (angular.sfx.dev.js:1342)
    at angular.sfx.dev.js:187

I can't really see what's going on at a grander scale, but I've deduced that global.assert gets defined in both SFX scripts, metioned above. (Potential problematic code below):

assertionsEnabled_ = typeof _global['assert'] !== 'undefined';
_global.assert = function assert(condition) {
  if (assertionsEnabled_) {
    _global['assert'].call(condition);
  }
};

This code seems fine for the first definition (as assertionsEnabled_ resolves to false), however, the second time around it resolves to true, therefore, whenever window.assert is called, Angular seems to get itself caught in an infinite loop, exceeding the maximum stack size.

@alfonso-presa
Copy link
Contributor

I can confirm this issue. It's happening to me also. String interpolation doesn't work at all. Keeps throwing the title error.

Adding the following code after including the sfx files did the trick for me:

window.assert= function () {return true;};

@mhevery
Copy link
Contributor

mhevery commented Sep 28, 2015

This should be resolved now that we have removed traceur

@mhevery mhevery closed this as completed Sep 28, 2015
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
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

3 participants