[v1] tsickle crashes during build: `TypeError: node.getFullStart is not a function`
See original GitHub issueType 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
ngPackage
w/ 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"
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:19 (4 by maintainers)
Top Results From Across the Web
[v1] tsickle crashes during build: `TypeError: node.getFullStart is not ...
[v1] tsickle crashes during build: `TypeError: node.getFullStart is not a function`
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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