wearethoughtfox / amnesty-facebook

0 stars 0 forks source link

Edge logs some console errors for XHR 404s #38

Closed pauldwaite closed 7 years ago

pauldwaite commented 7 years ago

Steps to reproduce

  1. In Edge (tested in Edge 38 on Windows 10), visit the app.
  2. Open the F12 developers tools, and switch to the console tab.
  3. Click on the “Nominate with Facebook” button.

Expected behaviour

No errors are logged in the console.

Actual behaviour

We get some XHR 404 errors for some of our vendor JavaScripts. I presume something in the JavaScript is triggering XMLHTTPRequests for these scripts, although I’m not sure why, as we load minified versions from our HTML. I guess there‘s maybe some require.js-style stuff going on somewhere?

The app still works, but obviously it’s a good idea to keep the console clear of errors, so that new mistakes are easier to spot.

edge-console

robertocarroll commented 7 years ago

Could this have been to do with the .map files that were in the vendor folder. I've deleted them and it doesn't seem to have caused any problems and it might fix this issue.

pauldwaite commented 7 years ago

Ah — the .map files allow the developer tools to reference un-minified line numbers in CSS and JavaScript files, even though the minified versions are served. So not absolutely necessary, but I don’t think they’d cause this bug.

I’ll take another look and see if it’s still happening.

robertocarroll commented 7 years ago

Ah OK. But something is making a call to backbone.js and underscore.js ie the unminfied versions. I can't think what it might be.

pauldwaite commented 7 years ago

Yeah it’s very weird. I tried deleting the map files and I’m not sure whether it fixed the issue or not — the F12 developer tools seemed to be crashing on me when I loaded the page.

Could be an instance of this issue: https://github.com/LLK/scratchx/issues/104

And it’s quite possible that the issue only occurs when the dev tools are open; if so, we don’t have to fix it: http://stackoverflow.com/questions/35142485/why-is-bootstrap-trying-to-load-less-files-in-edge

robertocarroll commented 7 years ago

So it's definitely dev tools related and possibly source map related. OK to close.