Skip to content

Exception when using pdf-visual-diff #95

@serhiy-yevtushenko

Description

@serhiy-yevtushenko

When trying to use pdf-visual-diff, I obtain the following exception (paths in stacktrace shortened to remove project-specific information):

TypeError: A dynamic import callback was invoked without --experimental-vm-modules
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:263:11)
    at pdf2png (...\node_modules\pdf-visual-diff\src\pdf2png\pdf2png.ts:74:27)
    at handleMissingSnapshot (...\node_modules\pdf-visual-diff\src\compare-pdf-to-snapshot.ts:212:31)
    at comparePdfToSnapshot (...\node_modules\pdf-visual-diff\src\compare-pdf-to-snapshot.ts:152:12) {
  code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG'
}

I'm trying to use pdf-visual-diff with jest typescript testing framework.

It would be good to document the proper way to configure jest to avoid such exceptions.

Operating system: Windows 11,
"pdf-visual-diff" version - "^0.14.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions