2
每當我跑我的角4的應用程序調用像這樣的一個枚舉...環境枚舉聲明錯誤
export declare enum RemoteStatus {
REMOTE = "REMOTE",
ACTIVATING = "ACTIVATING",
ACTIVE = "ACTIVE",
DEACTIVATING = "DEACTIVATING",
INACTIVE = "INACTIVE",
}
export declare enum Status {
UNKNOWN = "UNKNOWN",
LOCKED = "LOCKED",
UNLOCKED = "UNLOCKED",
}
它給我的NG出錯服務控制檯。
ERROR in D:/Projects/nem-swiftbc-app/node_modules/nem-library/dist/src/models/account/AccountInfo.d.ts (4,14): In ambient enum declarations member initializer must be constant expression.
ERROR in D:/Projects/nem-swiftbc-app/node_modules/nem-library/dist/src/models/account/AccountInfo.d.ts (5,18): In ambient enum declarations member initializer must be constant expression.
這可以防止加載應用程序。任何線索如何解決?
你能刪除'declare'並重試嗎?並刪除最後一個逗號? – echonax
@echonax嘗試刪除聲明,但它沒有奏效。仍然得到相同的錯誤。 –
您正在使用哪個TS版本?你有沒有試過升級它? –