evanderkoogh / otel-cf-workers

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

Errors importing module #112

Closed johtso closed 2 months ago

johtso commented 3 months ago

I'm trying to use the package in a Typescript Cloudflare Worker project, but I'm getting errors when I try to import it.

Could not resolve "@microlabs/otel-cf-workers"

    src/index.ts:7:44:
      7 │ ...t { instrument, ResolveConfigFn } 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"
         ╵                    ~~~~~~~~~~~~~~~~~~~~~

If I look at the contents of node_modules I see that the index.js file is in ./dist/esm/src/index.js rather than ./dist/esm/index.js

Any ideas what might be going wrong? Is there some post install build step that's not happening or something?

jahands commented 2 months ago

Sorry about that folks, this is a bug that was introduced in #105 We have reverted the change and released @microlabs/otel-cf-workers@1.0.0-rc.32 to resolve the issue.