Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 150
    • Issues 150
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Issues
  • #145

Closed
Open
Opened Oct 27, 2019 by Guillaume@mogztter
  • Report abuse
  • New issue
Report abuse New issue

Cannot read property 'getBoundingClientRect' of undefined

I'm not sure what is happening but the following error is thrown:

Uncaught (in promise) TypeError: Cannot read property 'getBoundingClientRect' of undefined
    at Page.addResizeObserver (quarkus-cheat-sheet.html:1799)
    at Page.addListeners (quarkus-cheat-sheet.html:1761)
    at Page.layout (quarkus-cheat-sheet.html:1715)
    at async Chunker.layout (quarkus-cheat-sheet.html:2506)
    at async Chunker.renderAsync (quarkus-cheat-sheet.html:2429)

quarkus-cheat-sheet.html

As a result the document is truncated/incomplete. Please note that when using a headless browser, I'm able to generate a complete PDF. So it might be a "concurrent exception" when the document is opened in a non-headless browser. Just to be clear, I do not scroll when Page.js is running, I just open the page in a browser.

If I add the following condition:

let wrapper = this.wrapper;
if (!wrapper) {
  return;
}

Then another exception is thrown:

quarkus-cheat-sheet.html:1776 Uncaught (in promise) TypeError: Cannot read property 'addEventListener' of undefined
    at Page.addListeners (quarkus-cheat-sheet.html:1776)
    at Page.layout (quarkus-cheat-sheet.html:1715)
    at async Chunker.layout (quarkus-cheat-sheet.html:2509)
    at async Chunker.renderAsync (quarkus-cheat-sheet.html:2432)
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: tools/pagedjs#145