williamsandonz
williamsandonz

Reputation: 16430

Angular compiler - Symbol without members expected

This seems to be quite a common issues at the moment. Please see here and here.

This enum is throwing the exception for me:

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

The error is:

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

Could someone clarify if my enum declaration is supported in Angular?

Could someone offer a solution to this issue?

My package.json contains:

"@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",

I've also tried this 4.0.0 and 4.3.0, same issue.

Upvotes: 0

Views: 664

Answers (1)

Andurit
Andurit

Reputation: 5762

As janousek mentioned in here, error happened because of this code in angular:

// 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;
}

Fix would be to downgrade to 4.2.X version e.g. 4.2.6

Upvotes: 1

Related Questions