2

When I open a angularjs app in iframe on a page everything works fine on all browsers. But then in firefox if I refresh using ctrl+f5 I get this very nasty error starting with nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame" ...

Please see image: (not sure if you can acutally read it) error

You can test it your self, open link https://www.ipushpull.com/embed/SCAR/Alpine in firefox, you should see login form, press ctrl+f5 and you should see the error.

Other browsers are fine.

I seen few other discussions, some mention this could be because of CORS requests (I am using) which I dont see probable because other requests are working fine in firefox on the same page (when you open taht page it makes request to the api that returns what it should)

Other mention it has something to do with window history, which might be because once you arrive to that link and API returns 403, it redirects you to angular uri #/user/login , but I didnt find any solution I could try out with the history.

Any ideas? thanks a lot

Update

I see you cannot open up the image, here is "full-res": https://i.stack.imgur.com/7SYQ8.jpg

Update 2

  1. This is not due to CORS issue. I am using CORS throughout the site without an issue, even there are other CORS requests on that very same page and they work.

  2. It is not caused by any adblock/popupblock addin, I tried in completely wiped out browser.

  3. Using non-minified angular for debugging - Actually I didn't think this would matter for debugging (as I have confidence in angular), but quess what. If I change to un-minified angular the error does not happen.. Any ideas?

Tomas
  • 2,676
  • 5
  • 41
  • 51
  • 1
    I really dislike websites that dont let you hit the back button. Here is the correct link for a "fuller" rez file: http://i.stack.imgur.com/7SYQ8.jpg – Ronnie Feb 10 '15 at 17:15
  • @Ronnie Actually this is basically embedding widget that you put into your site. So the navigation is done purely by the app. I just gave the direct link so you can see it fullscreen. – Tomas Feb 10 '15 at 17:18
  • @Ronnie Jesus even the dropbox link didn't work? ... Thanks for the link, will edit the question, or I will just upload it again to imgur – Tomas Feb 10 '15 at 17:19
  • 2
    ah, gotcha. yeah the dropbox link was small. When you upload an image via SO, it gets uploaded to imgur and if you right click it and 'view image' or 'open image in new tab' it will show you the larger image. – Ronnie Feb 10 '15 at 20:21
  • 1
    [http://stackoverflow.com/questions/16101187/what-does-this-error-mean-request-unsuccessful-nsresult-0x80004005-ns-error] have you try this ?? – HoangHieu Feb 16 '15 at 09:51
  • 3
    You should probably start by not using the .min version of Angular if trying to debug or make others debug – lajarre Feb 16 '15 at 09:53
  • [http://stackoverflow.com/questions/5686377/0x80004005-ns-error-failure-nsidomhtmlformelement-submit] and here – HoangHieu Feb 16 '15 at 10:21
  • Do you have any source code I could look at? My hunch is that you are missing a semicolon which actually can matter sometimes when minifying or there is a variable that isn't being used. Example: `function (v1, v2) {alert(v1)}` notice that v2 is not used, that type of thing can break minimized angular code. – njfife Feb 17 '15 at 17:32
  • @njfife I guess you would have to analyze all the code there is and thats quite a project. I have jshint in my grunt build setup, it gives me 3 errors at the moment, will try to fix them if that could help.. – Tomas Feb 18 '15 at 10:17
  • @njfife do you have any explanation why missing semicolon or unused variable would break minimized angular? – Tomas Feb 18 '15 at 10:17
  • I can't reproduce the error. Try updating angular to latest STABLE version, and update firefox too – gafi Feb 18 '15 at 22:19
  • Also make sure that you don't have a watcher, anywhere, that would do an ajax request on every digest cycle. – floribon Feb 20 '15 at 01:56
  • I tried refreshing your site several times on Firefox 23.0.1, and it worked fine. Then i upgraded, and got the error you've specified. So apparently it works on older versions of FF. Weird thing. – Kjell Ivar Feb 21 '15 at 19:31
  • can not reproduced this in FF 35.0.1 also, rootScope:infdig means you have an infinite digest loop. – ilj Feb 22 '15 at 06:42

2 Answers2

1

I have run into a similar issue trying to open an Ember app using history.pushState (Ember Router location: 'history' method of routing) inside an iframe. It appears the issue only occurs when doing a hard refresh (cmd + shift + r on Mac or ctrl + f5 on Windows) in Firefox. The issue only occurs for me in FireFox, works fine in Chrome and Safari with similar hard refresh. I also verified that the issue occurs for me as well opening an Angular JS app using $locationProvider html5mode(which also uses history.pushState under the hood) in an iframe in FireFox.

The issue does not occur for me when navigating to the page for the first time or when normally refreshing the page (cmd + r Mac, f5 Windows). I have found many seemingly related on Bugzilla for Mozilla but many are close. This one seems to represent the same issue I am having and is still open as of current versions of Firefox (v37.0.1 at time of writing).

https://bugzilla.mozilla.org/show_bug.cgi?id=1003100

Opening either an Ember or Angular app(or whatever technology...) in an iframe which uses hash based routing appears to be a viable work around for now. I could not reproduce the issue using hash based routing methods for either framework.

munsellj
  • 1,587
  • 13
  • 23
  • This seems to have been resolved on angularJs 1.4. I get this kind of error only on version 1.2.7 – albanx Sep 18 '15 at 12:54
0

Minification in AngularJS causes problem if you don't declare the service dependencies list (in an array) followed by the function itself. However, I looked through your code and looks like you got it covered. I could be missing something here, so it's a good idea to go over one more time just in case.

On another hand, it could be false negative. I also got some errors in Chrome when I refresh the page before all the dependency js files are fully loaded. Since you have Firebug Persist mode, some requests are not canceled and causes an overflow exception like the 3rd one in your attached image.

So for this error, if you turn off the watches, they should go away.

Arielle Nguyen
  • 2,932
  • 1
  • 20
  • 15
  • Minification is a general Angular JS pitfall but is not relevant here(would result in module injection errors, not one like is discussed in this issue). – munsellj Apr 15 '15 at 15:59