You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following runtime error in a CJS node.js (v22.12.0) micro service:
TypeError: A dynamic import callback was invoked without --experimental-vm-modules
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:264:11)
at pdf2png (.../node_modules/.pnpm/pdf-visual-diff@0.14.0/node_modules/pdf-visual-diff/src/pdf2png/pdf2png.ts:74:27)
at compareWithSnapshot (.../node_modules/.pnpm/pdf-visual-diff@0.14.0/node_modules/pdf-visual-diff/src/compare-pdf-to-snapshot.ts:223:31)
at comparePdfToSnapshot (.../node_modules/.pnpm/pdf-visual-diff@0.14.0/node_modules/pdf-visual-diff/src/compare-pdf-to-snapshot.ts:150:12)
at comparePdfs (.../node/document-generation-service/src/testutils/compare-pdfs.ts:14:26)
at generate-registration-pdf.test.ts:56:7
It seems that the function pdf2png in pdf2png.ts does the following dynamic import: const { getDocument } = await import('pdfjs-dist/legacy/build/pdf.mjs');
According to my understanding dynamic import aren't supported in CJS or how should I use the library in a CJS setup?
The text was updated successfully, but these errors were encountered:
The Error
I get the following runtime error in a CJS node.js (v22.12.0) micro service:
It seems that the function pdf2png in pdf2png.ts does the following dynamic import:
const { getDocument } = await import('pdfjs-dist/legacy/build/pdf.mjs');
According to my understanding dynamic import aren't supported in CJS or how should I use the library in a CJS setup?
The text was updated successfully, but these errors were encountered: