mapbox / pixelmatch

The smallest, simplest and fastest JavaScript pixel-level image comparison library
ISC License
6.1k stars 304 forks source link

CommonJS based require throws error #137

Closed p1100i closed 2 months ago

p1100i commented 2 months ago

In the README.md file, there is an example given which has a line: const pixelmatch = require('pixelmatch');

With the current 6.0.0 release, this throws the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module <PATH_A> from <PATH_B> not supported.

My node:

node --version
v22.3.0

Is this a deliberate change?

mourner commented 2 months ago

Yes, sorry, forgot to update the readme. See the release changes for v6 here: https://github.com/mapbox/pixelmatch/releases/tag/v6.0.0