I want to apologize in advance for my English. I am encountering a problem when running `ng build --prod` on my Angular project. The following errors are being returned: ERROR in Error: Error: Internal error: unknown identifier undefined at Object.importExpr$$1 [as importExpr] (..\node_modules\@angular\compiler\bundles\compiler.umd.js) at tokenExpr (node_modules\@angular\compiler\bundles\compiler.umd.js) at providerDef (node_modules\@angular\compiler\bundles\compiler.umd.js) at node_modules\@angular\compiler\bundles\compiler.umd.js at Array.map (native) at NgModuleCompiler.compile (node_modules\@angular\compiler\bundles\compiler.umd.js) at AotCompiler._compileModule (node_modules\@angular\compiler\bundles\compiler.umd.js) at node_modules\@angular\compiler\bundles\compiler.umd.js at Array.forEach (native) at AotCompiler._compileImplFile (node_modules\@angular\compiler\bundles\compiler.umd.js) at node_modules\@angular\compiler\bundles\compiler.umd.js at Array.map (native) at AotCompiler.emitAllImpls (node_modules\@angular\compiler\bundles\compiler.umd.js) at AngularCompilerProgram.generateFilesForEmit (node_modules\@angular\compiler-cli\src\transformers\program.js) at AngularCompilerProgram.emit (node_modules\@angular\compiler-cli\src\transformers\program.js) at AngularCompilerPlugin._emit (node_modules\@ngtools\webpack\src\angular_compiler_plugin.js)
Below is my package.json:
{
...
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/cdk": "^5.2.4",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.2.4",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "^1.7.3",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^4.2.4",
"@types/hammerjs": "^2.0.34",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"ng2-translate": "^5.0.0",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "2.4.2"
...
}
}
When I use ng serve or ng build, no errors occur. If anyone has faced this issue before, please share how it can be resolved.