Issue: unknown identifier in ionic build --prod

Hey guys,

When I build my app on prod mode (–prod) I got an error:

any ideas?

[12:44:31]  ionic-app-scripts 1.3.4
[12:44:31]  build prod started ...
[12:44:31]  clean started ...
[12:44:31]  clean finished in 3 ms
[12:44:31]  copy started ...
[12:44:31]  ngc started ...
[12:44:36]  ionic-app-script task: "build"
[12:44:36]  Error: Internal error: unknown identifier {}
Error: Internal error: unknown identifier {}
    at _TsEmitterVisitor._resolveStaticSymbol (\node_modules\@angular\compiler\bundles\compiler.umd.js:18944:19)
    at _TsEmitterVisitor._visitIdentifier (\node_modules\@angular\compiler\bundles\compiler.umd.js:18962:23)
    at _TsEmitterVisitor.visitExternalExpr (\node_modules\@angular\compiler\bundles\compiler.umd.js:18624:14)
    at ExternalExpr.visitExpression (\node_modules\@angular\compiler\bundles\compiler.umd.js:15817:24)
    at _TsEmitterVisitor.AbstractEmitterVisitor.visitBinaryOperatorExpr (\node_modules\@angular\compiler\bundles\compiler.umd.js:1
    at BinaryOperatorExpr.visitExpression (\node_modules\@angular\compiler\bundles\compiler.umd.js:15961:24)
    at _TsEmitterVisitor.AbstractEmitterVisitor.visitIfStmt (\node_modules\@angular\compiler\bundles\compiler.umd.js:18002:24)
    at IfStmt.visitStatement (\node_modules\@angular\compiler\bundles\compiler.umd.js:16384:24)
    at \node_modules\@angular\compiler\bundles\compiler.umd.js:18425:58
    at Array.forEach (native)
npm ERR! errno 1
npm ERR! ionic-politimob@1.0.0 ionic:build: `ionic-app-scripts build "--prod"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-politimob@1.0.0 ionic:build script 'ionic-app-scripts build "--prod"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-politimob package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build "--prod"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ionic-politimob
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ionic-politimob
npm ERR! There is likely additional logging output above.

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.8.0
Xcode version: Not installed
"dependencies": {
    "@angular/common": "4.0.3",
    "@angular/compiler": "4.0.3",
    "@angular/compiler-cli": "4.0.3",
    "@angular/core": "4.0.3",
    "@angular/forms": "4.0.3",
    "@angular/http": "4.0.3",
    "@angular/platform-browser": "4.0.3",
    "@angular/platform-browser-dynamic": "4.0.3",
    "@ionic-native/camera": "3.5.0",
    "@ionic-native/core": "3.5.0",
    "@ionic-native/facebook": "3.5.0",
    "@ionic-native/splash-screen": "3.5.0",
    "@ionic-native/status-bar": "3.5.0",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.0.1",
    "ionicons": "3.0.0",
    "ng-lazyload-image": "3.1.0",
    "rxjs": "5.3.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.8"
  "devDependencies": {
    "@ionic/app-scripts": "1.3.4",
    "typescript": "~2.2.1"

Can you also share any unusual providers you have in any of your modules? I’m thinking angular #15188 might be related.

1 Like

Yay that’s it. I had one empty provider definition.

1 Like