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

Cannot read property 'exp' of undefined #185

Closed
dichiohare opened this issue Jul 28, 2014 · 34 comments
Closed

Cannot read property 'exp' of undefined #185

dichiohare opened this issue Jul 28, 2014 · 34 comments
Labels

Comments

@dichiohare
Copy link

Hi,

I've come across the following issue in the image below. There must be something that i'm missing but I can't put my finger on it.

image

I have the following scripts included:
jquery-2.1.1.js
angular.js (v1.2.20)
bootstrap.js (v3.1.1)
angular-ui-tree.js

The controller and html code is pretty much the same as in the connected trees demo.

Thank you.

@bsr203
Copy link

bsr203 commented Aug 3, 2014

same here. probably after upgrading angular / ui tree

it may be changes in this pull

#164

@monad98
Copy link

monad98 commented Aug 4, 2014

when I disable Batarang, this problem went away.

@PierrickP
Copy link

Same problem here with the 2.1.5
Back to 2.1.4 for no error.

@monad98 tried whithout batarand, still error.

@CaffeinatedFunctionality

I have the same error

@Rudeg
Copy link

Rudeg commented Sep 2, 2014

Have the same error only in chrome, when attributes are not defined.

@mikedaly
Copy link

mikedaly commented Sep 5, 2014

Same problem here. Running Angular 1.2.23. It is complaining about 'maxDepth' (angular-ui-tree.js:646:17) and 'dragEnabled' (angular-ui-tree.js:769:17), both of which are the first attr.$watch() statements in their respective functions. Neither attributes is defined explicitly in my HTML.

@clementprevot
Copy link
Contributor

Could you set up a plunkr or jsFiddle that reproduce this problem so I can take a look at it.

Thank you!

@clementprevot clementprevot self-assigned this Sep 6, 2014
@mikedaly
Copy link

mikedaly commented Sep 8, 2014

I'll see if I can generate a minimal set that exhibits the problem.

Note that I have wrapped angular-ui-tree in my own directive.

@fregante
Copy link

It was definitely Batarang for me. I disabled it and it went away
cannot read property exp of undefined caused by batarang

@jazzina
Copy link

jazzina commented Sep 30, 2014

Same error when drag-enabled=true

@mikcox
Copy link

mikcox commented Sep 30, 2014

+1, I was running into the same exact issue, in Chrome with the Batarang plugin enabled, where I would get console errors and no drag and drop functionality. Disabling Batarang fixed the console errors for me, but this isn't really a good long-term fix since I'd like to continue using Batarang for future debugging! Is there any progress on a good solution to this?

Cheers!

@julian-iFactory
Copy link

+1, Error only showed in Google Chrome and disappeared when Batarang disabled.

@yevhene
Copy link

yevhene commented Oct 23, 2014

+1 Batarang

@icfantv
Copy link

icfantv commented Oct 23, 2014

This is still happening to me with Batarang disabled. Any one have other updates?

@icfantv
Copy link

icfantv commented Oct 27, 2014

I debugged the non-compressed version of this and was able to work around the issues by conditionally adding the watch only if the attribute was present in the case of attrs.maxDepth and attrs.dragDelay. And also adding data-collapsed="false" to both <li> elements that had ng-repeats.

We are not using drag-and-drop so I don't know if doing what I did has any adverse side effects. I can say that at least initially, there are none in our app. Doing the above got rid of the errors for us.

@onemenny
Copy link

+1, this is so annoying

@jplo
Copy link

jplo commented Nov 12, 2014

+1

@luckylooke
Copy link

+1 for conflict with batarang

@volumetric
Copy link

+1 for problem due to batarang
if you want to keep using batarang, for debugging, you can try putting a conditional for $watch calls for attrs.maxDepth etc.. as suggested by @icfantv

@TeemoWan
Copy link

+1

@bayy
Copy link

bayy commented Nov 26, 2014

same error here with batarang enabled. angular-ui-tree ver 2.1.5

@MagicIndustries
Copy link

The problem is that the angular-ui-tree code is doing a typeOf == 'number', so if you pass 0 in as an html attribute it sees it as a string. I found if I specified the attribute and passed it a variable I set in the scope, IE $scope.maxDepth = 0; it works and removes the 'exp' undefined error when you're using batarang.

Perhaps the code receiving this attribute should cast it to a number, or the check should be made more tolerant?

For reference, the code in question is this:
t.$watch(r.maxDepth, function (e) {
if (typeof e == "number") {
t.maxDepth = e
}
});

which appears on line 506 when I auto-layout the minified code.

@Voles
Copy link
Member

Voles commented May 2, 2015

@MagicIndustries are you up to create a PR for this?

@Voles Voles closed this as completed May 2, 2015
@kadosh1000
Copy link

Just happened to me too, disabling batarnag did the job

@MarkisLt
Copy link

AngularJS v1.4.4
Angular UI Tree v2.8.0

Disabling Batarang helped.

@BlakeBrown
Copy link
Contributor

Made a pull request #664 to fix this issue in the latest version

@Vixxd
Copy link

Vixxd commented Apr 9, 2016

Hi all,

I'm still getting this issue without batarang. I have the map included on a single page:

        <ui-gmap-google-map center='map.center' zoom='map.zoom'>
            <ui-gmap-marker coords="marker.coords" idkey="marker.id">
            </ui-gmap-marker>
        </ui-gmap-google-map>

and the following code to init:


    if (site.status) {
      $scope.error = ... etc.
    } else {
      getMapData();
      ...
    }

    var getMapData = function () {
      //Get map data
      $scope.map = {
        center: {
          latitude: $scope.site.location.x,
          longitude: $scope.site.location.y
        },
        zoom: 5
      };

      //Get marker to display on map
      $scope.marker = {
        id: 0,
        coords: {
          latitude: $scope.site.location.x,
          longitude: $scope.site.location.y
        }
      };
    };

The error is as follows:

angular.js:13424 TypeError: Cannot read property 'exp' of undefined
    at setIfChange (angular-google-maps.js:1900)
    at Scope.$digest (angular.js:16869)
    at angular.js:17064
    at completeOutstandingRequest (angular.js:5824)
    at angular.js:6100

Versions:

    "angular": "^1.4.0",
    "angular-google-maps": "~2.2.1",

Any help would be appreciated.

@nordoff
Copy link

nordoff commented May 25, 2016

@Vixxd Try upgrading to 2.3.3. Moving from 2.0.11 to 2.3.3 fixed a Cannot read property 'exp' of undefined" for me

@archasek
Copy link

archasek commented Jun 1, 2016

@nordoff how did you upgrade it?

@nordoff
Copy link

nordoff commented Jun 1, 2016

I am using bower, so I simply changed the version in dependency list in my bower.js

@archasek
Copy link

archasek commented Jun 1, 2016

@nordoff I did it too but IMHO it doesn't work as the most recent version is 2.15.0 O_o

Could you please give me the exact bower.json line?

@nordoff
Copy link

nordoff commented Jun 1, 2016

@archasek
"angular": "^1.5.2",
"angular-google-maps": "2.3.3",

Hope that helps

@ladmerc
Copy link

ladmerc commented Nov 5, 2016

+1. Same issue using uib-typeahead.

Disabling batarang works, but that's not ideal

@DrGadget604
Copy link

DrGadget604 commented Apr 5, 2017

thanks! had the same error but with angular inspector, which is based on batarang
edit: batarang itself doesn't produce the error in my case ^^

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

No branches or pull requests