Skip to content

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

Closed

Description

@nweedon

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.

Activity

  1. alfonso-presa commented on Aug 28, 2015

    @alfonso-presa
    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;};
  2. mhevery commented on Sep 28, 2015

    @mhevery
    Contributor

    This should be resolved now that we have removed traceur

  3. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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