leafac / kill-the-newsletter

Convert email newsletters into Atom feeds
https://kill-the-newsletter.com
MIT License
2.31k stars 113 forks source link

pin dependency-version to pre-ESM #79

Closed toelke closed 1 year ago

toelke commented 1 year ago

I would get this error message when running kill-the-newsletter after building it myself:

node:internal/modules/cjs/loader:1041
    throw new ERR_REQUIRE_ESM(filename, true);
    ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /tmp/caxa/kill-the-newsletter/2srbcxrtto/node_modules/@leafac/html/build/index.mjs not supported.
Instead change the require of /tmp/caxa/kill-the-newsletter/2srbcxrtto/node_modules/@leafac/html/build/index.mjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/tmp/caxa/kill-the-newsletter/2srbcxrtto/distribution/index.js:13:16) {
  code: 'ERR_REQUIRE_ESM'

Since caxa ignores the package-lock.json, version 3.0.3 of leafac/html is installed, which already is migrated to use ESM imports; with this PR I require the old version of the dependency that can be imported normally.