Error occurred during command execution from a CLI plugin


#1

I got this error when using --prod flag while building ionic cordova build android --prod
I have the latest versions of everything in my package.json anyone faced this problem before?

$ ionic cordova build android --prod
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser

[15:51:12]  build prod started ...
[15:51:12]  clean started ...
[15:51:12]  clean finished in 9 ms
[15:51:12]  copy started ...
[15:51:12]  ngc started ...
[15:51:38]  ngc finished in 26.14 s
[15:51:38]  preprocess started ...
[15:51:38]  deeplinks started ...
[15:51:40]  deeplinks finished in 1.80 s
[15:51:40]  optimization started ...
[15:51:41]  copy finished in 28.58 s
[15:52:16]  optimization finished in 36.17 s
[15:52:16]  preprocess finished in 37.98 s
[15:52:16]  webpack started ...
[15:54:36]  webpack finished in 140.11 s
[15:54:36]  sass started ...
[15:54:36]  uglifyjs started ...
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
Error: Unexpected token operator «=», expected punc «,» in C:\Users\Osama\ParentApp\www\build\main.js at line 109481, col 38, pos 4249270

#2

What is your ionic info output?


#3
$ ionic info

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.2.0

System:

    Node       : v7.9.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

#4

Interesting.

Can you look into here and find out what it is? Is it part of your code or something else?

Might be a case for https://github.com/ionic-team/ionic-cli/issues/new


#5

@Sujan12 here’s what appearing in this line

function debounce(fn, wait, immediate = false) {

why it refuses the =?


#6

related https://github.com/mishoo/UglifyJS2/issues/1400#issuecomment-265184196


#7

related https://github.com/ionic-team/ionic-app-scripts/issues/999
this issue blocking me from generating --prod optimised build version any ideas guys?


#8

I think this will solve the problem