angular-cli: Symbol without members expected error after 2.4.7 -> 4.0.0-beta.8

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior After moving from 2.4.7 to 4.0.0-beta.8 I’m getting the following error when executing ng build -prod. Just ng build (without -prod) works fine.

ERROR in Illegal state: symbol without members expected, but got {“filePath”:“C:/Projects/myproj/node_modules/@angular/router/index.d.ts”,“name”:“router_private”,“members”:[“ROUTER_PROVIDERS”]}.

Expected behavior

ng build -prod should work as ng build

Please tell us about your environment: Windows 10, @angular/cli 1.0.0-beta.32.3

  • Angular version: 4.0.0-beta.8
  • Node (for AoT issues): node --version = 7.5.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 21 (2 by maintainers)

Most upvoted comments

I found the problem. For some reason the production build is compiling the spec.ts files although the documentation says it is exclude “**/*.spec.ts” files by default. I added this to src/tsconfig.json: "exclude": [ "**/*.spec.ts" ]

Now it compiles successfully (ng build -prod) with the unit test re-enabled.

i had the same problem, fixed it by running a different build command line:

instead of ng build --prod use ng build --env=prod