2017-07-27 71 views
0

這似乎是目前相當常見的問題。請參閱herehere角編譯器 - 無預期成員的符號

這個枚舉拋出異常對我來說:

export enum UserRole { 
    CareGiver = 0, 
    CareReceiver = 1 
} 

的錯誤是:

ERROR in Illegal state: symbol without members expected, but got {"filePath":"C:/Users/William-Work/Desktop/findchildcare/src/app/shared/enums/user_role_enum.ts"," 
le","members":["CareGiver"]}. 

ERROR in ./src/main.ts 
Module not found: Error: Can't resolve './$$_gendir/app/components/app/app.module.ngfactory' in 'C:\Users\William-Work\Desktop\findchildcare\src' 
@ ./src/main.ts 3:0-89 
@ multi ./src/main.ts 

可以,如果我的枚舉聲明在角支撐有人澄清?

有人可以提供這個問題的解決方案嗎?

我的package.json包含:

"@angular/animations": "^4.1.3", 
    "@angular/common": "^4.1.3", 
    "@angular/compiler": "^4.1.3", 
    "@angular/core": "^4.1.3", 
    "@angular/forms": "^4.1.3", 
    "@angular/http": "^4.1.3", 
"@angular/platform-browser": "^4.1.3", 
    "@angular/platform-browser-dynamic": "^4.1.3", 
"@angular/cli": "^1.1.2", 
    "@angular/compiler-cli": "^4.1.3", 
    "@angular/language-service": "^4.1.3", 

我也試過這種4.0.0和4.3.0,同樣的問題。發生的,因爲這些代碼角

回答

0

here提到janousek,錯誤:

// Stop simplification at builtin symbols or if we are in a reference context 
if (expression === self.injectionToken || expression === self.opaqueToken || 
    self.conversionMap.has(expression) || references > 0) { 
    return expression; 
} 

修復將是降級到4.2.x版版本例如4.2.6