-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with pixelmatch ES import into an ES Playwright test #143
Comments
My device is hacked and its legal licence is charged |
? |
I don't know what are you talking about and I don't understand why are you sending random PDFs with no real content |
I get similar problems, I get this: Any suggestions to get rid of this? I started to get this "warning" when I updated to use node 22.12.0 and the latest version of the pixelmatch lib |
Same issue, fallback to version 5 solve my problem |
After read changeLog of V6 " Breaking: publish pixelmatch as a ES module. Use the older v5.3.0 if you need to support CommonJS environments. " |
Hi there
I am trying to use Pixelmatch 6.0 (ES module pixelmatch) on a TS project
It shouldn't be a problem, however, when importing it in a Playwright test, I get this problem in the beginning of the test file (not even in the import statement):
Error: require() of ES Module C:\Sources\RTCP.DepTMS\WebClient\PlanReview\BlueEthos.Web.UI\node_modules\pixelmatch\index.js from C:\Sources\RTCP.DepTMS\WebClient\PlanReview\BlueEthos.Web.UI\playwright\tests\integration\plan-review.spec.ts not supported. Instead change the require of index.js in C:\Sources\RTCP.DepTMS\WebClient\PlanReview\BlueEthos.Web.UI\playwright\tests\integration\plan-review.spec.ts to a dynamic import() which is available in all CommonJS modules.playwright
Following the advice to use a dynamic import it works, but I don't understand why, as this is not a CommonJS module.
I've removed the @types/pixelmatch module as it was for a previous CommonJS version, but no luck.
What could be happening? this is a non sense.
Let me know if I can do some checks to find out what the problem is.
Thanks
The text was updated successfully, but these errors were encountered: