Hey all. We are developing in a node environment and are having some incompatibility issues with the ESM packaging on the http client. We are seeing an ERR_REQUIRE_ESM when attempting to import the http-client module:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/varunp/Documents/protocol/node_modules/@ceramicnetwork/http-client/lib/ceramic-http-client.js from /Users/varunp/Documents/protocol/packages/persistence/src/cloud/CeramicCloudStorage.ts not supported.
Instead change the require of ceramic-http-client.js in /Users/varunp/Documents/protocol/packages/persistence/src/cloud/CeramicCloudStorage.ts to a dynamic import() which is available in all CommonJS modules.
Is there a version of the http-client that is packaged with commonJS (for example an older version we can pin to)?
To answer your question, it might be difficult to find a HTTP client version that doesn’t use ESM but that’s still new enough to be compatible with a reasonably new Ceramic Core. Otherwise you might be forced to use a version of the Core that is missing many important bug fixes and enhancements, and moreover might have issues interacting with other nodes on the network.
Still, tagging @ukstv in case he has an answer regarding an older (usable) version of the client, or some alternative.