I'm using the latest version of page-count library within a function to count pages in various document formats. The function, pageCounter, works successfully for files with extensions like pdf, pptx, and some docx files. However, I'm encountering the error "Unhandled Rejection at: [object Promise] reason: Cannot read properties of undefined (reading '0')" for certain docx files.
The error seems to occur with docx files that have complex layouts, including elements like multiple columns, embedded objects (images, charts), or specific fonts.
Simpler docx files with minimal formatting are processed correctly by DocxCounter.count.
I'm using the latest version of page-count library within a function to count pages in various document formats. The function, pageCounter, works successfully for files with extensions like pdf, pptx, and some docx files. However, I'm encountering the error "Unhandled Rejection at: [object Promise] reason: Cannot read properties of undefined (reading '0')" for certain docx files.
The error seems to occur with docx files that have complex layouts, including elements like multiple columns, embedded objects (images, charts), or specific fonts. Simpler docx files with minimal formatting are processed correctly by DocxCounter.count.