Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

391
Views
Uncaught (in promise) Error: item doesn't belong to list paged.polyfill.js error

I'm using PagedJS to add footers and headers to the html templates that we convert to PDF in our website. The code's been working fine for a week until this morning when this error keeps popping up.

Console Error

This is my code:

<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
        <script>
            class MyHandler extends Paged.Handler {
                constructor(chunker, polisher, caller) {
                    super(chunker, polisher, caller);
                }
                beforeParsed(content) {
                    // Chapters Counter
                    $("head").append(`
                        <style>body{counter-set: chapters ${content.querySelectorAll(".chapter").length};}</style>
                    `);                        
                }

                afterPageLayout(pageFragment, page){
                    //if pageFragment does not have a page class, delete it
                    if(pageFragment.querySelectorAll(".page").length == 0){
                        console.log("Hiding page!");
                        console.log(pageFragment);
                        pageFragment.setAttribute("style", "display:none;");
                    }
                }

            }
            Paged.registerHandlers(MyHandler);
        </script>

Any help would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!