ERROR in Error encountered resolving symbol values statically. Expression form not supported
ng serve -> works fine
ng build --prod --aot=false -> works fine
ng -build --prod -> fails with
ERROR in Error encountered resolving symbol values statically. Expression form not supported (position 12:36 in the original .ts file), resolving symbol HourControlComponent in hour-control.component.ts
My package
"dependencies": { "@angular/cli": "1.0.0", "@angular/animations": "^4.0.1", "@angular/common": "^4.0.1", "@angular/compiler": "^4.0.1", "@angular/compiler-cli": "^4.0.1", "@angular/core": "^4.0.1", "@angular/forms": "^4.0.1", "@angular/http": "^4.0.1", "@angular/material": "2.0.0-alpha.9-3", "@angular/platform-browser": "^4.0.1", "@angular/platform-browser-dynamic": "^4.0.1", "@angular/platform-server": "^4.0.1", "@angular/router": "^4.0.1", "angular2-jwt": "0.1.28", "core-js": "2.4.1", "moment": "2.17.1", "rxjs": "^5.2.0", "ts-helpers": "1.1.1", "typescript": "^2.2.2", "zone.js": "^0.8.5" }, "devDependencies": { "@types/hammerjs": "2.0.33", "@types/jasmine": "2.2.30", "codelyzer": "~0.0.26", "jasmine-core": "2.4.1", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "2.0.0", "karma-cli": "1.0.1", "karma-jasmine": "1.0.2", "karma-remap-istanbul": "0.2.1", "protractor": "4.0.9", "ts-node": "1.2.1", "tslint": "3.13.0" }
My code
import { BaseDataService, ProjectsService, ProposalsService } from '../services/projects-proposals-service/projects-proposals.service';
@Component({ templateUrl: './hour-control.component.html', styleUrls: ['./hour-control.component.css'] }) export class HourControlComponent implements OnInit { public projectList = [];
constructor(private baseService: ProjectsService | ProposalsService) { } ...
The bold line is where the compiler fails.
Can someone help me?
Got the same at /node_modules/.bin/xi18n
At least I solve it removing BaseDataService from all imports and export all service classes
export class BaseDataService {...
I have a problem, please look at this issue : http://stackoverflow.com/questions/43558082/error-in-error-encountered-resolving-symbol-values-statically-reference-to-a-lo
Heya, errors like Error encountered resolving symbol values statically mean that there has been some problem in statically analyzing your app.
The CLI always runs statical analysis on code to ensure it will run when compiled with AOT. This may cause a lot of static analysis errors to surface when importing your project into the CLI, or upgrading for older versions where we didn't run this kind of analysis.
Good resource on how to to debug these errors are https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60 and https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.