Angular-cli: Cannot read property 'Private' of undefined

Created on 1 Mar 2017  Â·  11Comments  Â·  Source: angular/angular-cli

OS?

OSX El Capitan

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0-rc.0
node: 6.9.1
os: darwin x64
@angular/common: 4.0.0-rc.1
@angular/compiler: 4.0.0-rc.1
@angular/core: 4.0.0-rc.1
@angular/forms: 4.0.0-rc.1
@angular/http: 4.0.0-rc.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.1
@angular/platform-browser-dynamic: 4.0.0-rc.1
@angular/router: 4.0.0-rc.1
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 4.0.0-rc.1

Repro steps.

ng serve

The log given by the failure.

MacBook-Pro-gkucmierz:coin-tools gkucmierz$ ng serve
Cannot read property 'Private' of undefined
TypeError: Cannot read property 'Private' of undefined
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/node_modules/tsickle/build/src/tsickle.js:111:40)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/node_modules/@angular/tsc-wrapped/src/main.js:11:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/node_modules/@angular/tsc-wrapped/index.js:14:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/src/compiler_host.js:14:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/src/codegen.js:15:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/compiler-cli/index.js:15:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/plugin.js:6:24)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:6:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/tasks/eject.js:10:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/models/webpack-configs/styles.js:7:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/models/webpack-configs/index.js:10:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/models/webpack-config.js:5:27)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/tasks/serve.js:11:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Class.run (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/commands/serve.js:94:52)
    at Class.<anonymous> (/Users/gkucmierz/learn/coin-tools/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

After migration to new version 1.0.0-rc.0 I have this error while serving app:
"Cannot read property 'Private' of undefined"

Most helpful comment

upgraded my typescript using npm and that fixed this issue

All 11 comments

Same issue when upgrading existing project on El Capitan (have not tried new project yet)


Your global Angular CLI version (1.0.0-beta.32.3) is greater than your local
version (1.0.0-beta.31). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".

                         _                           _  _

__ _ _ __ __ _ _ _ | | __ _ _ __ ___ | |(_)
/ _|| '_ \ / _ || | | || | / _` || '__|_____ / __|| || |
| (_| || | | || (_| || |_| || || (_| || | |_____|| (__ | || |
__,_||_| |_| __, | __,_||_| __,_||_| ___||_||_|
|___/
@angular/cli: 1.0.0-beta.31
node: 6.9.5
os: darwin x64
@angular/animations: 4.0.0-rc.1
@angular/common: 4.0.0-rc.1
@angular/compiler: 4.0.0-rc.1
@angular/compiler-cli: 4.0.0-rc.1
@angular/core: 4.0.0-rc.1
@angular/forms: 4.0.0-rc.1
@angular/http: 4.0.0-rc.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.1
@angular/platform-browser-dynamic: 4.0.0-rc.1
@angular/platform-server: 4.0.0-rc.1
@angular/router: 4.0.0-rc.1
@angular/cli: 1.0.0-beta.31

EDITED TO ADD

tsc -v

Version 2.2.1

Peters-MacBook-Pro:player anselpeters$ ng serve
Your global Angular CLI version (1.0.0-beta.32.3) is greater than your local
version (1.0.0-beta.31). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Cannot read property 'Private' of undefined
TypeError: Cannot read property 'Private' of undefined
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/tsickle/build/src/tsickle.js:111:40)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/tsc-wrapped/src/main.js:11:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/tsc-wrapped/index.js:14:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/compiler-cli/src/compiler_host.js:14:21)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/compiler-cli/src/codegen.js:15:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/compiler-cli/index.js:15:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@ngtools/webpack/src/plugin.js:5:24)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@ngtools/webpack/src/index.js:5:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/models/webpack-configs/typescript.js:4:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/models/webpack-configs/index.js:9:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/models/webpack-config.js:4:27)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/tasks/serve.js:10:26)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Class.run (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/commands/serve.js:74:52)
at Class. (/Users/anselpeters/Zend/workspaces/angular/SmarterSignManager/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)

upgraded my typescript using npm and that fixed this issue

It also worked for me, thx
Looks like there is another problem after upgrading ng cli.

Closing as answered.

Which version of typescript does not give this error ?

@agatsoh I updated to typescript v2.2.1 and it works now

Had the same problem with typescript: 2.0.0. After update to ~2.2.1 the problem was solved.

my versions all latest but the problem continue
PS D:\workspace\panel\panel> npm outdated
Package Current Wanted Latest Location
@angular/common 2.4.10 2.4.10 4.0.2
@angular/compiler 2.4.10 2.4.10 4.0.2
@angular/core 2.4.10 2.4.10 4.0.2
@angular/forms 2.4.10 2.4.10 4.0.2
@angular/http 2.4.10 2.4.10 4.0.2
@angular/platform-browser 2.4.10 2.4.10 4.0.2
@angular/platform-browser-dynamic 2.4.10 2.4.10 4.0.2
@angular/router 3.4.10 3.4.10 4.0.2
@angular/upgrade 2.4.10 2.4.10 4.0.2
@types/core-js 0.9.35 0.9.35 0.9.41
@types/node 6.0.70 6.0.70 7.0.13
chartist 0.9.8 0.9.8 0.11.0
concurrently 3.0.0 3.0.0 3.4.0
jquery 3.1.1 3.1.1 3.2.1
lite-server 2.2.2 2.2.2 2.3.0
rxjs 5.0.1 5.0.1 5.3.0
systemjs 0.19.47 0.19.47 0.20.12
typescript 2.0.10 2.0.10 2.2.2
zone.js 0.7.8 0.7.8 0.8.5

I have the same issue , How to update typscript please ?

ok i did , npm install -g typescript and it solved the problem

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._

Was this page helpful?
0 / 5 - 0 ratings