Updating to Angular 5 and the latest ng-packagr gives library build errors Cannot read property 'type' of undefined
See original GitHub issueType of Issue
[*] Bug Report
[ ] Feature Request
Description
I have updated angular to 5.0 (cli - 1.5.0). Angular suggests to update typescript to version ‘>=2.4.2 & <2.5.0’
but when i Build my library with “build”: “ng-packagr -p ng-package.json”, it gives me an error
BUILD ERROR Cannot read property ‘type’ of undefined TypeError: Cannot read property ‘type’ of undefined - this is with the node_modules typescript.js file.
I can get rid of this error by updating typescript to latest i.e, 2.6.1, but then angular gives an build warning
build warning -> angular/compiler-cli@5.0.0 requires typescript@‘>=2.4.2 <2.5.0’ but 2.6.1 was found instead. Using this version can result in undefined behaviour and difficult to debug problems.
How To Reproduce
update ng-packagr to latest version update angular to 5.0
Then build your package with “build”: “ng-packagr -p ng-package.json”
Expected Behaviour
Should be working fine typescript@‘>=2.4.2 <2.5.0’
Version Information
ng-packagr: "^1.5.0"
node: v7.7.2
@angular: v5.0.0
rxjs: ^5.4.2,
zone.js: 0.8.14
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Top GitHub Comments
I found what was wrong on our package. We had one
import { Observable } from 'rxjs';
replaced that withMy version info:
And this is working fine.
Hi @dherges
Thanks for your response.
I have tried with both the versions. I have typescript v2.4.2
with v1.5.1 i get the same error,
BUILD ERROR Cannot read property 'type' of undefined TypeError: Cannot read property 'type' of undefined
with v1.6.0-rc.0, i get a different error now,
BUILD ERROR ENOENT: no such file or directory, open '/Library/WebServer/istweb/Documents/supporting-apps/istweb-core/src/istweb-core/.ng_pkg_build/@ccs-istweb-core/ts/istweb-core.js' Error: ENOENT: no such file or directory, open '/Library/WebServer/istweb/Documents/supporting-apps/istweb-core/src/istweb-core/.ng_pkg_build/@ccs-istweb-core/ts/istweb-core.js'