[v5.0.0.-rc7] Page number demo -> "TypeError: Cannot read property 'CURRENT' of undefined"
See original GitHub issueIs it possible that some configuration or such is missing from the page numbers demo? https://github.com/dolanmiu/docx/blob/master/demo/14-page-numbers.ts
I am using v5.0.0-rc7 and I am getting this error when running it:
TypeError: Cannot read property 'CURRENT' of undefined
EDIT: Same error for demo 39: https://github.com/dolanmiu/docx/blob/master/demo/39-page-numbers.ts
I did not only come to complain, however 😃 Thank you @dolanmiu for this library, and especially for the new rewrite: it makes code much more readable and intuitive.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'current' of undefined
The bot can't read the property of current . You used current after results[0] , which means that that's undefined.
Read more >creating a unit test typeerror: cannot read property ... - You.com
It is complaining that cannot read property 'replace' of undefined. replace is a method of String in JS and instead it found undefined...
Read more >About this Book - Angular 2 Development with TypeScript
This book covers Angular 2.0.0 Final. How to read this book. Our early drafts of this book started with chapters on ECMAScript 6...
Read more >testcafe - UNPKG
205 .page`http://devexpress.github.io/testcafe/example`; ... 736, * Fixed an error (`Cannot read property 'on' of undefined`) that occurred when testing ...
Read more >https://raw.githubusercontent.com/valor-software/n...
... Demo site does not load resources \(valor-software.com/ng2-charts/\) ... navigation error occurs - "Cannot read property 'onDestroy' of undefined" ...
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
Hello @acgrama,
You can use pageNumber() and numberOfTotalPages() functions of TextRun according to the API: https://docx.js.org/#/usage/page-numbers I created an example in codepen according to demo 39: https://codepen.io/wcqrnj/pen/abzBNqJ
Unfortunatelly the header of the first page is not different in case of demo 14: https://codepen.io/wcqrnj/pen/yLyVOEN
Fortunetelly there is a workaround. You can create two sections and add different footers: https://codepen.io/wcqrnj/pen/zYxoBvE
Cheers, He-Wolf
Thanks for your kind words 😃
Probably because it isn’t exported, i will fix in the next release