Closed
Description
Describe the bug
I just configured your plugin as mentioned in the documentation. We're using TypeScript and we get an error while starting our Cypress tests.
Your configFile is invalid: C:\Users\BenjaminM\Desktop\scripts\cypress\cypress.config.ts
It threw an error when required, check the stack trace below:
file:///C:/Users/BenjaminM/Desktop/scripts/cypress/node_modules/@frsource/cypress-plugin-visual-regression-diff/dist/plugins.mjs:7
import { addMetadata, getMetadata } from 'meta-png';
^^^^^^^^^^^
SyntaxError: Named export 'addMetadata' not found. The requested module 'meta-png' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'meta-png';
const { addMetadata, getMetadata } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
at async loadFile (C:\Users\BenjaminM\AppData\Local\Cypress\Cache\10.10.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:106:14)
at async EventEmitter. (C:\Users\BenjaminM\AppData\Local\Cypress\Cache\10.10.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:116:32)
I have just installed your package, set up the configuration in cypress.config.ts
and then started the test run.
Please complete the following information:
- OS and version: Windows 11 (Version 22H2, Build: 22621.819)
- Browser and version: Chrome (Version 108.0.5359.125)
- Cypress version: 10.10.0