Skip to content

Commit 6f230c2

Browse files
authored
fix: pull from the default export which is available in both ESM and CJS (#1468) (#1493)
1 parent 1472268 commit 6f230c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/xl-docx-exporter/src/docx/docxExporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class DOCXExporter<
154154
geistMonoFont instanceof Uint8Array
155155
) {
156156
// conversion with Polyfill needed because docxjs requires Buffer
157-
const Buffer = (await import("buffer")).Buffer;
157+
const Buffer = (await import("buffer")).default.Buffer;
158158

159159
if (interFont instanceof ArrayBuffer) {
160160
interFont = Buffer.from(interFont);
@@ -243,7 +243,7 @@ export class DOCXExporter<
243243
try {
244244
if (!globalThis.Buffer) {
245245
// load Buffer polyfill because docxjs requires this
246-
globalThis.Buffer = (await import("buffer")).Buffer;
246+
globalThis.Buffer = (await import("buffer")).default.Buffer;
247247
}
248248
return Packer.toBlob(doc);
249249
} finally {

0 commit comments

Comments
 (0)