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

Most upvoted comments

@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.