evanderkoogh / otel-cf-workers

An OpenTelemetry compatible library for instrumenting and exporting traces for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
245 stars 51 forks source link

Missing `./dist/esm/index.js` etc. built files #166

Closed Cherry closed 1 month ago

Cherry commented 1 month ago

In previous versions, this library would publish dist/esm/index.js and similar files, and this is what the package.json points to.

Since https://github.com/evanderkoogh/otel-cf-workers/commit/d0dcc8337e91ab3df41f209517a14e314009c28f, it seems these are now only available in dist/esm/src/index.js, which breaks importing the library with errors like:

✘ [ERROR] Could not resolve "@microlabs/otel-cf-workers"

    src/index.ts:1:27:
      1 │ import { instrument } from '@microlabs/otel-cf-workers';
        ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The module "./dist/esm/index.js" was not found on the file system:

    node_modules/@microlabs/otel-cf-workers/package.json:11:19:
      11 │         "default": "./dist/esm/index.js"
         ╵                    ~~~~~~~~~~~~~~~~~~~~~

This seems to have occurred between 1.0.0-rc.45 and 1.0.0-rc.46 https://npmdiff.dev/%40microlabs%2Fotel-cf-workers/1.0.0-rc.45/1.0.0-rc.46

evanderkoogh commented 1 month ago

Wait what?! Didn't think I changed anything there?

I might just rip off the commonjs bandaid and go esm-only..