Recently while working on a SharePoint hosted app, I encountered an issue where the App page was not loading correctly. The SharePoint hosted app was hosted on a site collection under the managed path "/sites" as in the following:
Error displayed in the IE developer toolbar is shown below.
type mismatch". Using the "Network" tab in the IE developer toolbar, I captured the page load network trace.
Shoot up the IE developer toolbar. Select the Network tab, click Start capturing and Trigger the app from ribbon. Then, let the page load and click "Stop capturing".
The same app was working perfectly in another web application! Notice the URL from where the JS is loaded:
I tried to hit this URL in the browser. For the web application where the app was working, I got a prompt to save the file. For the web application where the app was not working, I did not get any response. So the path from where the JS was being loaded was incorrect or did not exist. !!
The issue was that the web application, where app was not working, did not have a site collection at the "/" managed path. Creating this root site collection at the "/" path resolved the issue.
Hope this helps.