webrecorder / warcio.js

JS Streaming WARC IO optimized for Browser and Node
MIT License
30 stars 6 forks source link

require() of ES Module base32-encode not supported #65

Open halmos opened 8 months ago

halmos commented 8 months ago

It looks like the transpiled warcio index.cjs is attempting to use a require( ) for the base32-encode module. However, base32-encode has stopped supporting cjs.

Our own project used babel to transpile down to cjs style require and so the downstream effect of the issue is the error:

Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/base32-encode/index.js from node_modules/warcio/dist/index.cjs not supported.
Instead change the require of index.js in node_modules/warcio/dist/index.cjs to a dynamic import() which is available in all CommonJS modules.

AFAIK there is nothing I can change in my own project settings to fix this. I believe there may be a config option in the warcio.js project setting for the TS compiler to address the issue, tho I'm unsure what that would be.