Incompatibility to cordova-ios 5.0.0?


#1

Steps to reproduce:

  1. Create Brand New Ionic Project.
  2. Upgrade package.json to latest @angular/ dependency packages (7.2.2)
  3. Run: npm i cordova-ios (5.0.0)
  4. Run ionic build (or npm run build or ng build)
  5. See error about ionic.core.js.

ERROR in ./node_modules/@ionic/core/dist/esm/es5/ionic.core.js 6:2160
Module parse failed: Unexpected token (6:2160)

Ionic:

ionic (Ionic CLI) : 4.10.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.13.1
@angular-devkit/schematics : 7.3.1
@angular/cli : 7.3.1
@ionic/angular-toolkit : 1.3.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

System:

NodeJS : v10.14.2 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61


#2

I have exactly the same problem…


#3

What does that mean? There is nothing from Ionic with that version number.


#4

+1, just ran into the same issue

ERROR in ./node_modules/@ionic/core/dist/esm/es5/ionic.core.js 6:2160
Module parse failed: Unexpected token (6:2160)
You may need an appropriate loader to handle this file type.
| * Built with http://stenciljs.com
| */

function n(n,t){return"sc-"+n.t+(t&&t!==c?"-"+t:"")}function t(n,t){return n+(t?"-h":"-s")}function e(n,t){for(var e,r,i=null,o=!1,u=!1,f=arguments.length;f-- >2;)A.push(arguments[f]);for(;A.length>0;){var c=A.pop();if(c&&void 0!==c.pop)for(f=c.length;f–;)A.push(c[f]);else"boolean"==typeof c&&(c=null),(u=“function”!=typeof n)&&(null==c?c="":“number”==typeof c?c=String©:“string”!=typeof c&&(u=!1)),u&&o?i[i.length-1].vtext+=c:null===i?i=[u?{vtext:c}:c]:i.push(u?{vtext:c}:c),o=u}if(null!=t){if(t.className&&(t.class=t.className),“object”==typeof t.class){for(f in t.class)t.class[f]&&A.push(f);t.class=A.join(" “),A.length=0}null!=t.key&&(e=t.key),null!=t.name&&(r=t.name)}return"function”==typeof n?n(t,i||,E):{vtag:n,vchildren:i,vtext:void 0,vattrs:t,vkey:e,vname:r,i:void 0,o:!1}}function r(n,t,e){void 0===e&&(e={});var r=Array.isArray(t)?t:[t],i=n.document,o=e.hydratedCssClass||“hydrated”,u=e.exclude;u&&(r=r.filter(function(n){return-1===u.indexOf(n[0])}));var c=r.map(function(n){return n[0]});if(c.length>0){var a=i.createElement(“style”);a.innerHTML=c.join()+"{visibility:hidden}."+o+"{visibility:inherit}",a.setAttribute(“data-styles”,""),i.head.insertBefore(a,i.head.firstChild)}var s=e.namespace||“Ionic”;return B||(B=!0,function l(n,t,e){(n[“s-apps”]=n[“s-apps”]||).push(t),e.componentOnReady||(e.componentOnReady=function t(){function e(t){if(r.nodeName.indexOf("-")>0){for(var e=n[“s-apps”],i=0,o=0;o<e.length;o++)if(n[e[o]].componentOnReady){if(n[e[o]].componentOnReady(r,t))return;i++}if(i<e.length)return void(n[“s-cr”]=n[“s-cr”]||).push([r,t])}t(null)}var r=this;return n.Promise?new n.Promise(e):{then:e}})}(n,s,n.HTMLElement.prototype)),applyPolyfills(n).then(function(){function t(){r.forEach(function(t){var e;!function r(n){return/{\s*[native code]\s*}/.test(""+n)}(n.customElements.define)?(e=function(t){return n.HTMLElement.call(this,t)}).prototype=Object.create(n.HTMLElement.prototype,{constructor:{value:e,configurable:!0}}):e=new Function(“w”,“return class extends w.HTMLElement{}”)(n),U[s].u(function i(n){var t=C(n),e=t.s,r=d(n[0]);return t.s=function(n){var t=n.mode,i=n.scoped;return function o(n,t,e){return import(
| /* webpackInclude: /.entry.js$/ /
| /
webpackMode: “lazy” */
[ERROR] An error occurred while running subprocess ng.


#5

He’s talking about the angular version.
ng update --all


#6

I have updated my angular version to 7.2.4, I still have this error.
here are my package.json dependencies

"dependencies": {
    "@angular/common": "~7.2.4",
    "@angular/core": "~7.2.4",
    "@angular/forms": "~7.2.4",
    "@angular/http": "~7.2.4",
    "@angular/platform-browser": "~7.2.4",
    "@angular/platform-browser-dynamic": "~7.2.4",
    "@angular/router": "~7.2.4",
    "@auth0/angular-jwt": "^2.1.0",
    "@fortawesome/fontawesome-free": "^5.7.1",
    "@ionic-native/core": "5.0.0",
    "@ionic-native/native-storage": "^5.0.0",
    "@ionic-native/splash-screen": "5.0.0",
    "@ionic-native/sqlite": "^5.0.0",
    "@ionic-native/status-bar": "5.0.0",
    "@ionic/angular": "4.0.1",
    "@ionic/pro": "2.0.4",
    "@ionic/storage": "^2.2.0",
    "cordova-android": "7.1.4",
    "cordova-ios": "5.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "6.0.1",
    "cordova-plugin-file-transfer": "1.7.1",
    "cordova-plugin-ionic": "5.3.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "3.0.0",
    "core-js": "^2.6.4",
    "es6-promise-plugin": "^4.2.2",
    "lodash": "^4.17.11",
    "rxjs": "~6.4.0",
    "sqlite": "3.0.1",
    "webpack-dev-server": "^3.1.14",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.1",
    "@angular-devkit/build-angular": "^0.13.1",
    "@angular-devkit/core": "~7.3.1",
    "@angular-devkit/schematics": "~7.3.1",
    "@angular/cli": "~7.3.1",
    "@angular/compiler": "^7.2.4",
    "@angular/compiler-cli": "^7.2.4",
    "@angular/language-service": "~7.2.4",
    "@ionic/angular-toolkit": "^1.3.0",
    "@ionic/app-scripts": "^3.2.2",
    "@types/jasmine": "^3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^10.12.24",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~8.0.2",
    "tslint": "~5.12.0",
    "typescript": "^3.2.4"
  },

#7

This issue seems to be related to the following modules and their dependencies on a different version of webpack - not cordova-ios itself. A temporary fix would be downgrading to these versions:

"@angular-devkit/architect": "0.12.4",
"@angular-devkit/build-angular": "0.12.4",

#8

@ainsley I downgraded those modules and it worked like a charm! Thanks a lot!


#9

Downgrading either

@angular-devkit/architect and @angular-devkit/build-angular

or downgrading to cordova-ios to 4.5.5

doesn’t seem like a good solution.


#10

Actually the problem is with ionic how to deal with newer version, it is indeed Ionic issue.


#11

Downgrading cordova-ios is not going to work, only @angular-devkit/architect and @angular-devkit/build-angular.


#12

Downgrading cordova-ios does work. It’s the work around I am using right now.

You can use all the latest packages, but the moment you update from cordova-ios 4.5.5 to 5.0.0, you’ll get this error.


#13

After upgrading everything and downgrading @angular-devkit/architect and @angular-devkit/build-angular to 0.12.4 I get the following error. I wanted to see if I was the only one or if I do in fact have to downgrade typescript.

ERROR in The Angular Compiler requires TypeScript &gt;=3.1.1 and &lt;3.3.0 but 3.3.3 was found instead.


#15

I did downgrade for cordova-ios and kept @angular-devkit/architect and @angular-devkit/build-angular to 0.13.1 and that does not work, but keeping cordova-ios to 5 and downgrade devkit things, working for me now.


#16

Just keep typescript to 3.2.4 for now, this is from angular-cli, not ionic nor any plugin


#18

Cordova, especially Cordova iOS has absolutely 0 connection to Angular and Typescript. It technically can not have influence on any of this, unless its presence somehow breaks the build process. But as cordova-ios 5.0.0 did not really change anything fundamental, this is extremely unlikely.


#19

I agree about Typescript and Angular. I’m not even sure why either of those things were mentioned in this thread. Doesn’t matter.

Back to the point of this thread, cordova-ios 5.0.0 doesn’t seem to be compatible with something, as when I run “Ionic Build” it still results in ERROR in ./node_modules/@ionic/core/dist/esm/es5/ionic.core.js 6:2160
Module parse failed: Unexpected token (6:2160)
.

I would prefer not to have to downgrade cordova-ios or any @angular-devkit libraries.


#20

As I said, it is impossible for Cordova iOS to cause this error as Cordova is not part of a normal build process of Ionic. The code isn’t run at all.

What exactly is the command you are executing?
What exactly is your current ionic info output now?
What does your package.json look like now?


#21

This is still a clear problem. Downgrading packages to old versions is a great workaround, but is by far a solution. The error produced is: ionic.core.js 6:2160
Module parse failed: Unexpected token (6:2160)
.

The command I am running is “ionic build”.

My ionic info looks like:


Ionic:

   ionic (Ionic CLI)             : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.1
   @angular-devkit/build-angular : 0.13.1
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

System:

   NodeJS : v10.14.2 (/usr/local/bin/node)
   npm    : 6.8.0
   OS     : macOS Mojave

My package.json looks like:


{
  "name": "deleteme",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.0.0",
    "cordova-ios": "^5.0.0",
    "core-js": "^2.5.4",
    "rxjs": "~6.3.3",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.1",
    "@angular-devkit/build-angular": "~0.13.1",
    "@angular-devkit/core": "~7.2.3",
    "@angular-devkit/schematics": "~7.2.3",
    "@angular/cli": "~7.2.3",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.4.0",
    "@types/node": "~10.12.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.0.0",
    "tslint": "~5.12.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project"
}

You’ll notice, this is basically a default blank starter template, with cordova-ios upgraded to latest version (5.0.0), @angular-devkit upgraded to latest (0.13.1) and @angular dependencies upgraded to latest (7.2.2).


#22

What happens if you do not update cordova-ios to 5.0.0 but only:

Same problem then?