Skip to content
New issue

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

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

Already on GitHub? # to your account

ng-inspector for AngularJS makes my angular app crashes on latest Chrome version #95

Closed
davidpelayo opened this issue Apr 15, 2015 · 12 comments
Labels

Comments

@davidpelayo
Copy link

After upgrading my Google Chrome stable channel today, my AngularJS application (1.4.x) crashed due to have this plugin activated.

  • Chrome version Version 42.0.2311.90 (64-bit).
  • OS X 10.10.3.

Directives weren't wrongly evaluated when injected to the module core of Angular, throwing the following error:
Error: [$injector:itkn] Incorrect injection token! Expected service name as string, got function () http://errors.angularjs.org/1.4.0-beta.5/$injector/itkn?p0=function%20() at REGEX_STRING_REGEXP (angular.js:68) at Object.invoke (angular.js:4245) at angular.js:6600 at forEach (angular.js:328) at Object.<anonymous> (angular.js:6598) at Object.invoke (angular.js:4260) at Object.enforcedReturnValue [as $get] (angular.js:4113) at Object.invoke (angular.js:4260) at angular.js:4078 at Object.getService [as get] (angular.js:4219)

Confirmed after deactivating the plugin my app bootstrapped again without any other issues.

@DrewML
Copy link
Collaborator

DrewML commented Apr 15, 2015

Hey @davidpelayo, apologies for the troubles. Do you have a link to a publicly accessible version of your app for us to attempt to replicate with?

If not, would it be possible for you to attempt to build a plnkr that we can use to replicate?

@rev087
Copy link
Owner

rev087 commented Apr 15, 2015

Additionally, what version of ng-inspector are you running?

@pherrmann
Copy link

Hey, just wanted to report I encountered the same issue straight away this morning. Looks like this extension was updated yesterday, 0.5.9. Deactivating the plugin fixes the issue.

My app isn't public. For what it's worth, it's using Angular 1.3.8 with RequireJS.

Chrome version Version 42.0.2311.90 m

@rev087
Copy link
Owner

rev087 commented Apr 15, 2015

@pherrmann could you please paste the error message you got in the console?

@rev087
Copy link
Owner

rev087 commented Apr 15, 2015

@pherrmann
Copy link

Sure, there's many instances of the following error for different directives on a particular screen. Here's a couple...

Error: [$injector:itkn] Incorrect injection token! Expected service name as string, got function ()
http://errors.angularjs.org/1.3.8/$injector/itkn?p0=function%20()
at REGEX_STRING_REGEXP (angular.js:63)
at Object.invoke (angular.js:4167)
at angular.js:6482
at forEach (angular.js:323)
at Object. (angular.js:6480)
at Object.invoke (angular.js:4182)
at Object.enforcedReturnValue as $get
at Object.invoke (angular.js:4182)
at angular.js:4000
at Object.getService as get


Error: [$injector:itkn] Incorrect injection token! Expected service name as string, got function globalToolbar($window){
return
http://errors.angularjs.org/1.3.8/$injector/itkn?p0=function%20globalToolbar(%24window)%7B%0D%0A%20%20%20%20%20%20%20%20return
at REGEX_STRING_REGEXP (angular.js:63)
at Object.invoke (angular.js:4167)
at angular.js:6482
at forEach (angular.js:323)
at Object. (angular.js:6480)
at Object.invoke (angular.js:4182)
at Object.enforcedReturnValue as $get
at Object.invoke (angular.js:4182)
at angular.js:4000
at Object.getService as get

@rev087
Copy link
Owner

rev087 commented Apr 15, 2015

@pherrmann thanks a lot! Would it be possible for you to paste the code for one of the directives? You can remove all the controller code if it's sensitive to your client/company, and would be a great help for us to solve this bug and write a test to avoid regressions in the future.

@rev087 rev087 added bug and removed possible bug labels Apr 15, 2015
@rev087
Copy link
Owner

rev087 commented Apr 16, 2015

A stackoverflow user had the same problem, and tracked down the issue: http://stackoverflow.com/questions/29653779/angular-itkn-error-caused-by-directives-defined-with-function-outside-array/29666410#29666410

Working on this now.

@rev087 rev087 closed this as completed in dfe4415 Apr 16, 2015
@rev087
Copy link
Owner

rev087 commented Apr 16, 2015

I rolled back on the directive factory annotation bit from Service.js, so strict-di with a non-annotated directive will break the extension again. In the end I couldn't reproduce this issue without removing the try…catch block around the .invoke() call.

With this rollback, this issue should be fixed in v0.5.10, which I just published to the Chrome store.

Edit: Actually, it won't break the extension, see this comment.

@tedhohio
Copy link

tedhohio commented Oct 4, 2015

Using Chrome 45.0.2454.101 and the latest ng-inspector. My app simply stops, no errors. Memory usage crepps up to the point where the Chrome error message puts and simply says "Something went wrong with displaying this webpage." Similar error on Firefox 41.0.1.

@istrau2
Copy link

istrau2 commented Dec 29, 2015

I have the same issue as tedohio. No errors but if I open ng-inspector, my app crashes.

@azmodii
Copy link

azmodii commented Apr 18, 2016

I can confirm this issue as well. I can replicate it by opening ng-inspector when I have a directive on the page - see angular-ui/angular-google-maps.

As soon as I comment out the gmap, the issue resolves itself. Feels like it might be an infinite recursion happening when its loading the model context.

Hope this helps

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

No branches or pull requests

7 participants