Module Destructuring Error after Upgrading Ceramic Related Libraries: OTLPMetricExporter

Hello everyone,

I recently upgraded the Ceramic and ComposeDB related libraries in my project from older versions to newer ones and encountered a destructuring error that I’m hoping to get some help and advice on.

Original Versions:

  • @composedb/client”: “0.6.0”
  • @composedb/types”: “^0.6.0”
  • @ceramicnetwork/http-client”: “4.0.0”

Upgraded Versions:

  • @composedb/client”: “0.7.1”
  • @composedb/types”: “^0.7.1”
  • @ceramicnetwork/http-client”: “5.8.0”

Error Message:
Uncaught TypeError: Cannot destructure property ‘OTLPMetricExporter’ of ‘opentelemetry_exporter_metrics_otlp_http__WEBPACK_IMPORTED_MODULE_0 _.default’ as it is undefined.

This error appears to be related to the way the @opentelemetry/exporter-metrics-otlp-http module is imported. Despite reviewing the code and dependencies, I am still unsure why this error has arisen following the upgrade.

Development Environment:

  • Node.js version: v20.10.0
  • Next.js version: 14.2.3

Has anyone encountered a similar issue or can offer any insights or solutions? Any advice or guidance would be greatly appreciated!

Thank you for your help!

Yes, this is a bug we just discovered yesterday, that was apparently introduced in version 5.7.0 of the http-client. We are working on a fix now. Sorry about that! For now, if you pin to version 5.6.0 of the http-client, that should unbreak things until we can get the fix out in a new release. Apologies for the inconvenience!

@tim please note that the release candidate we published today should fix this issue: Discord

It will promoted from release candidate and published as a full release a week from today, but in the meantime you can also run against the RC and if you do please let us know if it fixes the issue you are seeing!

1 Like