Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Ionic2 - Failed to load resource: The requested URL was not found on this server on iOS #988

Closed
grapemix opened this issue May 13, 2017 · 3 comments

Comments

@grapemix
Copy link

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

Unable to run the app correctly in iOS if ionic build --prod is run.

In the console, the error msg is:

Failed to load resource: The requested URL was not found on this server. file:///MY_PROJECT_ABSOLUTE_PATH/www/build/main.js.map Failed to load resource: The requested URL was not found on this server.

All labels translated from the ngx-translate are missing, but the other function seems fine.

However, no one can deliver an app without labels nor super slow.

What behavior are you expecting?

Not breaking in iOS.

Steps to reproduce:

  1. ionic build --prod
  2. run in iOS
insert any relevant code between the above and below backticks

part of the package.json

  "config": {
    "ionic_rollup": "./config/rollup.config.js",
    "ionic_copy": "./config/copy.config.js",
    "ionic_generate_source_map": true,
    "ionic_bundler": "rollup"
  },

part of the rollup.config.js

  entry: process.env.IONIC_APP_ENTRY_POINT,
  sourceMap: process.env.IONIC_GENERATE_SOURCE_MAP ? true : false,
  format: 'iife',
  dest: process.env.IONIC_OUTPUT_JS_FILE_NAME,

Which @ionic/app-scripts version are you using?
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.19
Node Version: v6.7.0
Xcode version: Not installed

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

  1. We noticed someone has filed a similar issue Ionic2 - Failed to load resource: The requested URL was not found on this server. #805 while he is using webpack + osx, but we are using rollup + Linux and still found the same issue.
  2. Our app works fine in ionic 2. We experienced this problem after upgrading to ionic 3.
  3. We have to force rollup to generate source map or the script won't compile(in ionic 2+3).
  4. We only experienced this problem in iOS devices. In android devices, even the source map path is written as absolute path in the main.js, our app works fine.
  5. We tried to manually replace the absolute path to relative(/MY_PROJECT_ABSOLUTE_PATH/www/build/main.js.map -> /build/main.js.map). The error message changes to "file:///build/main.js.map Failed to load resource: The requested URL was not found on this server." For some reason, iOS insisted to use absolute path and not willing to provide the app storage prefix. So it gives us no choice but file an issue in here
@grapemix
Copy link
Author

Actually, we found that our developers is missing a slash during path replacement. Our app run fine in iOS AFTER the path replacement. Sorry for your time.

@darkthsideous
Copy link

@grapemix path replacement?

@darkthsideous
Copy link

please post your solution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants