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
Do you happen to know what might be the issue? the comparePdfToSnapshot method is failing with:
TypeError: process.getBuiltinModule is not a function
at NodeCanvasFactory._createCanvas (node_modules\pdfjs-dist\legacy\build\webpack:\pdf.js\src\display\node_utils.js:84:8)
at NodeCanvasFactory.create (node_modules\pdfjs-dist\legacy\build\webpack:\pdf.js\src\display\canvas_factory.js:35:25)
at node_modules\pdf-visual-diff\src\pdf2png\pdf2png.ts:56:46
at handleMissingSnapshot (node_modules\pdf-visual-diff\src\compare-pdf-to-snapshot.ts:212:18)
at tests\smoke-tests\pdf.spec.ts:15:18
test output:
Running 1 test using 1 worker
Warning: Cannot polyfill DOMMatrix, rendering may be broken.
Warning: Cannot polyfill ImageData, rendering may be broken.
Warning: Cannot polyfill Path2D, rendering may be broken.
F
Do you happen to know what might be the issue? the comparePdfToSnapshot method is failing with:
TypeError: process.getBuiltinModule is not a function
at NodeCanvasFactory._createCanvas (node_modules\pdfjs-dist\legacy\build\webpack:\pdf.js\src\display\node_utils.js:84:8)
at NodeCanvasFactory.create (node_modules\pdfjs-dist\legacy\build\webpack:\pdf.js\src\display\canvas_factory.js:35:25)
at node_modules\pdf-visual-diff\src\pdf2png\pdf2png.ts:56:46
at handleMissingSnapshot (node_modules\pdf-visual-diff\src\compare-pdf-to-snapshot.ts:212:18)
at tests\smoke-tests\pdf.spec.ts:15:18
my playwright test code:
test('Compare pdf-visual-diff', async () => {
const pathToPdf = path.resolve('.test-data', 'smoke-tests', 'temp-files', 'pdf', 'check_20140219_001.pdf');
const fileContent = fs.readFileSync(pathToPdf);
const result = await comparePdfToSnapshot(fileContent, __dirname, 'report', {
failOnMissingSnapshot: false,
});
console.log(result);
});`
test output:
Running 1 test using 1 worker
Warning: Cannot polyfill
DOMMatrix
, rendering may be broken.Warning: Cannot polyfill
ImageData
, rendering may be broken.Warning: Cannot polyfill
Path2D
, rendering may be broken.F
1 failed
[testing] › smoke-tests\pdf.spec.ts:7:5 › Compare pdf-visual-diff ───────────────────────────────
configuration:
node v20.15.0
npm 10.7.0
pdf-visual-diff 0.14.0
The text was updated successfully, but these errors were encountered: