Error only when building with --prod flag


#1
ionic cordova run ios --prod --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
Running app-scripts build: --prod --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --externalIpRequired --nobrowser

[09:21:29]  build prod started ...
[09:21:29]  clean started ...
[09:21:29]  clean finished in less than 1 ms
[09:21:29]  copy started ...
[09:21:29]  ngc started ...
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
[DEBUG] Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/larpo/Projects/lavanda/ops/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
            at syntaxError (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:1550:34)
            at simplifyInContext (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23870:23)
            at StaticReflector.simplify (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23882:13)
            at StaticReflector.annotations (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23331:41)
            at NgModuleResolver.resolve (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:13883:70)
            at CompileMetadataResolver.getNgModuleMetadata (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:14473:60)
            at addNgModule (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23050:58)
            at /Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23061:14
            at Array.forEach (native)
            at _createNgModules (/Users/larpo/Projects/lavanda/ops/node_modules/@angular/compiler/bundles/compiler.umd.js:23060:26)

➜  ops git:(master) βœ— ionic info

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 6.4.0
    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.0.0 browser 4.1.0 ios 4.3.1
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.8.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002
    ios-deploy : 1.9.0
    ios-sim    : 5.0.13

#2

Are you using OpaqueToken in your code? It’s been deprecated.


#3

Thanks. Resolved by updating everything package.json to the latest versions as per: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md