ngx-extended-pdf-viewer: Error: startCleanup: Page X is currently rendering
Describe the bug We are receiving crash reports:
Error: startCleanup: Page 5 is currently rendering.
at ? (/Content/cg/js/angular/assets/viewer-2.6.423.min.js:22:55931)
I was only able to find related code in the minified version of viewer (why it is not present in original version?):
startCleanup() {
return this.messageHandler.sendWithPromise("Cleanup", null).then(() => {
for (let e = 0, t = this.pageCache.length; e < t; e++) {
const t = this.pageCache[e];
if (t) {
if (!t.cleanup()) throw new Error(`startCleanup: Page ${e + 1} is currently rendering.`)
}
}
this.commonObjs.clear();
this.fontLoader.clear()
})
}
I don’t even know if it is critical or not.
Version info
- Version of ngx-extended-pdf-viewer - 7.3.2
Desktop (please complete the following information):
- Browser Chrome
Smartphone (please complete the following information):
- Device: PC
To Reproduce
There is no reliable way to reproduce, but it happens quite often.
My best guess is that it happens when users do fast open/close and pages are still rendering when onDestroy is triggered https://github.com/stephanrauh/ngx-extended-pdf-viewer/blob/30933c416106a2ac642027e28ab5bf94cdd4db92/projects/ngx-extended-pdf-viewer/src/lib/ngx-extended-pdf-viewer.component.ts#L1308
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- #645 added the `(pageRender)` event which is sent when a page is about to be rendered (as opposed to `(pageRendered)`, which is sent when the page has finished rendering) — committed to stephanrauh/ngx-extended-pdf-viewer by stephanrauh 3 years ago
- stephanrauh/ngx-extended-pdf-viewer#645 delay cleanup if the page is currently rendering — committed to stephanrauh/pdf.js by stephanrauh 3 years ago
- stephanrauh/ngx-extended-pdf-viewer#645 don't show error messages if the PDF viewer is destroyed while rendering the sidebar — committed to stephanrauh/pdf.js by stephanrauh 3 years ago
- stephanrauh/ngx-extended-pdf-viewer#645 delay cleanup if the page is currently rendering — committed to stephanrauh/pdf.js by stephanrauh 3 years ago
- stephanrauh/ngx-extended-pdf-viewer#645 don't show error messages if the PDF viewer is destroyed while rendering the sidebar — committed to stephanrauh/pdf.js by stephanrauh 3 years ago
- #645 make the cleanup() method more resilient - if you can't clean up the page proxy, clean it up after finishing the render task; don't report errors if the PDF viewer is destroyed while it's still r... — committed to stephanrauh/ngx-extended-pdf-viewer by stephanrauh 3 years ago
@stephanrauh the above issue is appearing only for latest version. I tried https://github.com/mozilla/pdf.js/releases/tag/v3.7.107, and there is no issue.