iOS build success but missing (404 errors) modules on device

#1

Android works without a problem. But when we build to iOS we get a couple of Not Found errors for modules, during the starting up of the app, that should have been included with the build.

Tried removing node_modules, platforms, plugins and www directories and rebuilding. And updating cordova and ionic. But this did not help.

See screenshot for error details:

package.json:

{
  "name": "MostAmazingApp",
  "version": "1.0.3",
  "author": "MostAmazingSoft",
  "homepage": "http://www.mostamazingsoft.test/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@ionic-native/core": "4.6.0",
    "@ionic-native/facebook": "4.6.0",
    "@ionic-native/file": "4.6.0",
    "@ionic-native/file-opener": "4.6.0",
    "@ionic-native/file-transfer": "4.6.0",
    "@ionic-native/http": "4.6.0",
    "@ionic-native/in-app-browser": "4.6.0",
    "@ionic-native/network": "4.6.0",
    "@ionic-native/pro": "4.6.0",
    "@ionic-native/splash-screen": "4.6.0",
    "@ionic-native/status-bar": "4.6.0",
    "@ionic/pro": "^1.0.20",
    "@ionic/storage": "^2.1.3",
    "@ngx-translate/core": "^9.1.1",
    "@ngx-translate/http-loader": "^2.0.1",
    "@types/xml2js": "^0.4.2",
    "cordova-android": "7.0.0",
    "cordova-android-support-gradle-release": "^1.4.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-advanced-http": "^1.11.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-facebook4": "^2.3.0",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-ionic": "^4.2.0",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.0.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.3.3",
    "font-awesome": "^4.7.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "js-marker-clusterer": "^1.0.0",
    "ls": "0.2.1",
    "minimist": "^1.2.0",
    "roboto-slab-fontface-kit": "^1.0.2",
    "rxjs": "5.5.7",
    "sw-toolbox": "3.6.0",
    "xml2js": "^0.4.19",
    "zone.js": "0.8.20"
  },
  "devDependencies": {
    "@angular/animations": "^5.2.10",
    "@angular/common": "^5.2.10",
    "@angular/compiler": "^5.2.10",
    "@angular/compiler-cli": "^5.2.10",
    "@angular/core": "^5.2.10",
    "@angular/forms": "^5.2.10",
    "@angular/http": "^5.2.10",
    "@angular/platform-browser": "^5.2.10",
    "@angular/platform-browser-dynamic": "^5.2.10",
    "@ionic-native/geolocation": "^4.7.0",
    "@ionic/app-scripts": "^3.1.8",
    "typescript": "~2.6.2"
  },
  "description": "The bestest",
  "cordova": {
    "plugins": {
      "cordova-plugin-ionic": {
        "APP_ID": "xxxxxxxx",
        "CHANNEL_NAME": "Develop",
        "UPDATE_METHOD": "auto",
        "MAX_STORE": "3",
        "WARN_DEBUG": "false",
        "UPDATE_API": "https://api.ionicjs.com",
        "ROLLBACK_TIMEOUT": "10",
        "MIN_BACKGROUND_DURATION": "30"
      },
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-advanced-http": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-geolocation": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-file": {},
      "cordova-android-support-gradle-release": {
        "ANDROID_SUPPORT_VERSION": "27.+"
      },
      "cordova-plugin-file-opener2": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "xxxxxxxx",
        "APP_NAME": "Most Amazing App",
        "ANDROID_SDK_VERSION": "4.+"
      },
      "cordova-plugin-ionic-webview": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  },
  "config": {
    "ionic_copy": "./scripts/copy-custom-libs.js"
  }
}

$ ionic info

Ionic:

   ionic (Ionic CLI)  : 4.0.6 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.8

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5

System:

   ios-deploy : 1.9.2
   NodeJS     : v6.10.2 (/usr/local/bin/node)
   npm        : 6.3.0
   OS         : macOS High Sierra
   Xcode      : Xcode 9.3 Build version 9E145

Environment:

   ANDROID_HOME : not set

Any help is much appreciated.

#3

This is outdated, update.

#4

Sorry for spamming people.

But I am getting the exact same errors, while having:

Updated

@ionic/app-scripts : 3.1.8

to

@ionic/app-scripts : 3.1.11

Also went through all other modules and updated where possible. New info:

package.json:

{
  "name": "xxx",
  "version": "1.0.3",
  "author": "xxx",
  "homepage": "http://www.xxx.xx/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@ionic-native/core": "4.11.0",
    "@ionic-native/facebook": "4.11.0",
    "@ionic-native/file": "4.11.0",
    "@ionic-native/file-opener": "4.11.0",
    "@ionic-native/file-transfer": "4.11.0",
    "@ionic-native/http": "4.11.0",
    "@ionic-native/in-app-browser": "4.11.0",
    "@ionic-native/network": "4.11.0",
    "@ionic-native/pro": "4.11.0",
    "@ionic-native/splash-screen": "4.11.0",
    "@ionic-native/status-bar": "4.11.0",
    "@ionic/pro": "^2.0.3",
    "@ionic/storage": "^2.1.3",
    "@ngx-translate/core": "^9.1.1",
    "@ngx-translate/http-loader": "^2.0.1",
    "@types/xml2js": "^0.4.2",
    "cordova-android": "7.0.0",
    "cordova-android-support-gradle-release": "^1.4.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-advanced-http": "^1.11.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-facebook4": "^2.3.0",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-ionic": "^4.2.0",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.0.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.3.3",
    "font-awesome": "^4.7.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "js-marker-clusterer": "^1.0.0",
    "ls": "0.2.1",
    "minimist": "^1.2.0",
    "roboto-slab-fontface-kit": "^1.0.2",
    "rxjs": "5.5.7",
    "sw-toolbox": "3.6.0",
    "xml2js": "^0.4.19",
    "zone.js": "0.8.20"
  },
  "devDependencies": {
    "@angular/animations": "^5.2.11",
    "@angular/common": "^5.2.11",
    "@angular/compiler": "^5.2.11",
    "@angular/compiler-cli": "^5.2.11",
    "@angular/core": "^5.2.11",
    "@angular/forms": "^5.2.11",
    "@angular/http": "^5.2.11",
    "@angular/platform-browser": "^5.2.11",
    "@angular/platform-browser-dynamic": "^5.2.11",
    "@ionic-native/geolocation": "^4.7.0",
    "@ionic/app-scripts": "^3.1.11",
    "typescript": "~2.6.2"
  },
  "description": "xxx",
  "cordova": {
    "plugins": {
      "cordova-plugin-ionic": {
        "APP_ID": "xxx",
        "CHANNEL_NAME": "Develop",
        "UPDATE_METHOD": "auto",
        "MAX_STORE": "3",
        "WARN_DEBUG": "false",
        "UPDATE_API": "https://api.ionicjs.com",
        "ROLLBACK_TIMEOUT": "10",
        "MIN_BACKGROUND_DURATION": "30"
      },
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-advanced-http": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-geolocation": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-file": {},
      "cordova-android-support-gradle-release": {
        "ANDROID_SUPPORT_VERSION": "27.+"
      },
      "cordova-plugin-file-opener2": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "xxx",
        "APP_NAME": "Compo Ticketing",
        "ANDROID_SDK_VERSION": "4.+"
      },
      "cordova-plugin-ionic-webview": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  },
  "config": {
    "ionic_copy": "./scripts/copy-custom-libs.js"
  }
}

$ ionic info

Ionic:

   ionic (Ionic CLI)  : 4.0.6 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5

System:

   ios-deploy : 1.9.2
   NodeJS     : v6.10.2 (/usr/local/bin/node)
   npm        : 6.3.0
   OS         : macOS High Sierra
   Xcode      : Xcode 9.3 Build version 9E145

Environment:

   ANDROID_HOME : not set
#5

Those are all .map in your error messages - does you app actually work without them?

#6

We are not consciously using the mapping functionality. We only use it as it is generated by itself. We did nothing special (or want to) to include those mappings.

#7

already tried to remove your platform and to add it again from scratch?

#8

We finally got the project working again :pray:

We removed everything (node_modules, platforms, plugins, www, .sourcemaps, package-lock) multiple times and tried many different things (plugin versions, new projects, isolating plugins and modules, etc.).

In the end it turned out to be the facebookplugin cordova-plugin-facebook4 that messed up the project.
Removed that plugin completely, because we are moving away from facebook anyway (like everybody should;)

Thanks to everybody who took the time to take a look! :+1:

#9

Cool to hear you found a solution, but, I’m these days maintaining this plugin and I’m personally using it, it just works fine and I don’t face any errors, do you have more information to provide?

#11

At the moment I can only tell you, removing it and the cordova-plugin-ionic fixed the project for Android and iOS. Building on iOS still gives some module.js.map 404 errors, but luckily those are not breaking the app.

If I find out more that possibly implicates the facebook plugin, I will let you know in a mention. Thank you for maintaining that plugin :+1:

#12

I do know that sometimes you have to remove and add the facebook4 plugin again if you face problem while removing and adding the android platform again…it’s like this, a bit a pain in the a but at the end it work out what does matter

Sure keep me posted thx