lalalic / docx4js

a javascript docx parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"officeDocument is not defined" when using ModelHandler

bcaure opened this issue · comments

When I declare
const ModelHandler = require("docx4js/lib/openxml/docx/model-handler").default;
I have the following error with node 7.0.0

(node:7814) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: officeDocument is not defined

In document.js line 63, there is a typo on officeDocument.identify should be OfficeDocument.identify

That's fixing the issue and then after that I have another error:

TypeError: officeDocument.styles is not a function

this fix indeed resolves the issue for me.

fixed