orbitdb-archive / orbit-db-io

Helper module used in OrbitDB to interface with storage layer
MIT License
7 stars 12 forks source link

ERR_REQUIRE_ESM with orbit-db-io 1.1.1-bac86ca.0 #39

Open cs145442 opened 2 years ago

cs145442 commented 2 years ago

Hello Collaborators, I'm experiencing issues with the latest update of orbit-db-io, which is a dependency for orbit-db.

Error [ERR_REQUIRE_ESM]: require() of ES Module /<project-path>/node_modules/orbit-db-io/index.js from /<project-path>/node_modules/ipfs-log/src/utils/index.js not supported.

Instead change the require of /<project-path>/node_modules/orbit-db-io/index.js in /<project-path>/node_modules/ipfs-log/src/utils/index.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/<project-path>/node_modules/ipfs-log/src/utils/index.js:6:12) at Object.<anonymous> (/<project-path>/node_modules/ipfs-log/src/entry.js:4:27) at Object.<anonymous> (/<project-path>/node_modules/ipfs-log/src/log.js:5:15) at Object.<anonymous> (/<project-path>/node_modules/orbit-db-store/src/Store.js:7:13) at Object.<anonymous> (/<project-path>/node_modules/orbit-db/src/OrbitDB.js:4:15) at Object.<anonymous> (/<project-path>/<filename>.js:11:17) { code: 'ERR_REQUIRE_ESM' }

Node.js v18.5.0

Hope can will be resolved soon. Thanks.

aphelionz commented 2 years ago

Thanks for this - are you getting this from a simple npm install orbit-db?

AlexMesser commented 2 years ago

Same here and yes, just from a simple npm install orbit-db. As a workaround added "orbit-db-io": "1.0.1" dependency in my project package.json.

cs145442 commented 2 years ago

@aphelionz I'm afraid so, yes! As a work-around I had to override and rely on the previous working version since this issue.

image