-
Notifications
You must be signed in to change notification settings - Fork 304
Ionic2 - Failed to load resource: The requested URL was not found on this server. #805
Comments
Same problem. In my case, using ionic build --prod and ionic run --device --prod. main.js is output and references main.js.map, but the sourcemap is not output. I also tried removing the reference to the sourcemap, but that didn't work either. I can run the app using ionic serve and ionic run --device. With the prod flag, I notice ngc is one of the build tasks. Could it be related to that? Your system information: Cordova CLI: 6.4.0 |
Any help please ? |
I finally resolved my issue. It was the export of my app.module in the barrel file in my app folder. In main.js, I imported app.module from the barrel file. When I changed that import to the app.module file specifically, the prod build works. For posterity:
Hence my suspicion of the ngc build task. Googling resulted in various things being reported like font imports, uglifyjs, etc. Everything I tried didn't work. Eventually, I just went back to old commits and tried the production build until I found one that worked. From there I began basically reconstructing the app to its current state until I discovered the main.js import. Another thing worth mentioning is that I updated the versions of all the packages my app uses. I played around with various combinations of package versions (based on other threads and reports), trying to determine if it may be in some way related. It turned out it wasn't, so now this is what my information looks like and it runs beautifully. Your system information: Cordova CLI: 6.4.0 @abomadi Does any of this sound familiar to your situation? What does your main.js look like? Do you use barrels similarly? |
@michaelyuen i really appreciate your help and sharing your case, my is app is a little bit big, however i am referencing the app.module directly no barrels.
after building --prod i found that it's references in main.js
This is the only place i found main.js.map requested, i tried to remove this line manually that app didn't report any errors but it did not initialize at all only blank white screen, i don't know honestly how to start debugging such case! also :
my app info command output
[12:59:16] ionic-app-scripts 1.2.3
Thanks |
any news? |
Yes, most probably the break comes from Webpack mostly with the import definitions i have created a PR to enable webpack show the errors while transpiling, #871 In my case the issue was from the import statement path case sensitive on Mac, the folders inside the solution were small letters but on mac directory were Capital ... using the modified script in the above PR will help you to know exactly where is your issue come from. |
|
I have the same issue as @grapemix:
If I remove the reference I don't get the error message, but still a blank screen. The prod build is working fine for Android. Here's my environment:
|
Hi, when trying to build a prod release it builds smoothly but when openning the app it gives the following error
Failed to load resource: The requested URL was not found on this server. file:///var/containers/Bundle/Application/39C211E1-ACD2-4798-96FF-8909F63DB55A/TestApp.app/www/build/main.js.map Failed to load resource: The requested URL was not found on this server.
command used to build this ionic build --prod --no-aot
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.10
OS: macOS Sierra
Node Version: v7.0.0
Xcode version: Xcode 8.2.1 Build version 8C1002
The text was updated successfully, but these errors were encountered: