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 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:
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: