Seems similar as this one, but that one was closed: #2539
Minimal example: https://stackblitz.com/edit/node-cuffquaa?file=index.js,test.docx.base64.json,package.json
import { patchDocument } from 'docx';
import { base64StringToBlob } from "blob-util";
import dataBase64 from './test.docx.base64.json' with { type: "json" };
// if you download data, everything works great
const data = base64StringToBlob(dataBase64);
const docx = await patchDocument({
data,
outputType: "base64"
});
console.log(docx);
The example is pretty basic, I get the following error:
Am I doing anything wrong?
Edit:
it works if I convert data like this
const data = new Uint8Array(await base64StringToBlob(FSGTemplate, DOCX_MIME_TYPE).arrayBuffer());