ng-packagr: [v1] tsickle crashes during build: `TypeError: node.getFullStart is not a function`
Type of Issue
[x] Bug Report
[ ] Feature Request
Description
Trying to setup ng-packagr on ngx-datatable, when i run the build I get the following errors.
> ng-packagr -p ng-package.json
Building Angular library
Generating bundle for @swimlane/ngx-datatable
Cleaning bundle build directory
Processing assets
Running ngc
BUILD ERROR
node.getFullStart is not a function
TypeError: node.getFullStart is not a function
at Annotator.Rewriter.writeNode (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:70:24)
at Annotator.Rewriter.visit (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:53:18)
at Annotator.maybeProcessEnum (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/tsickle.js:1188:22)
at Annotator.maybeProcess (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/tsickle.js:676:29)
at Annotator.Rewriter.visit (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:52:19)
at /Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:84:19
at visitEachNode (/Users/austin/dev/ngx-datatable/node_modules/typescript/lib/typescript.js:15956:30)
at Object.forEachChild (/Users/austin/dev/ngx-datatable/node_modules/typescript/lib/typescript.js:16136:24)
at Annotator.Rewriter.writeNode (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:82:12)
at Annotator.Rewriter.visit (/Users/austin/dev/ngx-datatable/node_modules/@angular/tsc-wrapped/node_modules/tsickle/build/src/rewriter.js:53:18)
How To Reproduce
- Clone https://github.com/swimlane/ngx-datatable
- Define
ngPackagew/ entry pointsrc/index.ts - Run
ng-packagr -p ng-package.json
Expected Behaviour
No errors
Version Information
ng-packagr: latest
node: v8
@angular: v5
"zone.js": "^0.8.18"
"rxjs": "^5.0.0"
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 19 (4 by maintainers)
What’s preventing this from being fixed? According to tsickle, they are just throwing warnings not errors, so why is this lib converting them to errors? This is an annoying problem considering it involves comments preventing the package being built.
So i found a solution, its seems to be a dirty hack: I changed
shouldIgnoreWarningsForPath: (filePath) => false,toshouldIgnoreWarningsForPath: (filePath) => true,in https://github.com/dherges/ng-packagr/blob/f895782e1f2fc6c954880cbb99567546d9d7a139/src/lib/util/ngc-patches.ts#L36The better way is to write a custom function in https://github.com/dherges/ng-packagr/blob/f895782e1f2fc6c954880cbb99567546d9d7a139/src/lib/steps/ngc.ts#L227
Just upgraded a project to
^2.4.5and now can’t compile the project because of@chillinski still an issue for me with v3.0.1… Same boat - large project that we’re in the process of migrating to 6.0 and I have a wall of this warning turned build breaking error exceeding my console’s buffer to deal with…
@dherges any way this can be fixed soon?
Same problem here, we have a big project with a lot of JSDoc annotations
try ng-packagr@next. It should have fixed this issue.