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

Batarang produces errors after Angular upgrade to 1.5 #285

Closed
Kapaacius opened this issue Feb 9, 2016 · 8 comments
Closed

Batarang produces errors after Angular upgrade to 1.5 #285

Kapaacius opened this issue Feb 9, 2016 · 8 comments

Comments

@Kapaacius
Copy link

I upgraded angular to 1.5 and this caused Batarang to produces errors to console.
Here's an example:

TypeError: Cannot read property '$id' of undefined
    at arguments.(anonymous function) (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2001:19)
@iltera
Copy link

iltera commented Feb 9, 2016

I am also getting the same error after upgrading to version 1.5

Is there any way to overcome these errors?

@gkalpak
Copy link
Member

gkalpak commented Feb 9, 2016

Could someone provide a live demo (e.g. using CodePen, Plnkr etc) ?

@oarcher
Copy link

oarcher commented Feb 9, 2016

I have the same problem, even on a 'hello world' example without ng-controller.

@SomeKittens
Copy link
Member

ditto on the live demo - we can't do much without a repro.

@Narretz
Copy link
Contributor

Narretz commented Feb 10, 2016

Check this plnkr, http://plnkr.co/edit/irPNf9sFY5LLRKSwvcsN?p=preview, BUT not in the edit view or the embedded view -> instead "launch the preview in a separate window" (little blue button in the preview window). The app still works, but you get the error from above.
I've tried it locally and a simple app still works, but it looks like every digest triggers that error.

@SomeKittens
Copy link
Member

Was able to repro. Looks like we're making some assumptions about the this value (specifically, that it has an $id) of the reaction function inside a watcher. Not up to date on 1.5 internals - what changed?

@Narretz
Copy link
Contributor

Narretz commented Feb 10, 2016

Looks like this here angular/angular.js@1c6edd4

gkalpak added a commit to gkalpak/angular-hint that referenced this issue Feb 10, 2016
Due to a change introduced in AngularJS `v1.5.0`
(angular/angular.js@1c6edd4), the
`watchAction` callback is called without a context (i.e. `this === undefined`). This caused an
error while trying to access `this.$id`.

Fixes angular/batarang#285
@gkalpak
Copy link
Member

gkalpak commented Feb 10, 2016

I have a submitted a fix angular/angular-hint#117.
Thx @Narretz for the repro (I wouldn't have tried it myself 😃).

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

6 participants