Skip to content

fix(simplelog): repair the /otel entry, which threw on import in 2.0.0 - #14

Merged
MurkyTheMurloc merged 1 commit into
mainfrom
fix/simplelog-otel-entry-broken
Sep 5, 2026
Merged

MurkyTheMurloc merged 1 commit into
mainfrom
fix/simplelog-otel-entry-broken

Conversation

@MurkyTheMurloc

Copy link
Copy Markdown
Owner
SyntaxError: Export named 'setSpanContextReader' not found in module
  .../@murky-web/simplelog/dist/logger_factory.js

The build runs two tsdown config blocks, one platform: "node" and one platform: "neutral", writing to the same outDir. logger_factory was an entry in neither, so each block emitted it keeping only the exports its own entries used, and whichever finished last decided the file. The neutral block's entries — deno, hono, web — never call setSpanContextReader, so when it won, the export was gone and dist/otel.js imported a binding that did not exist.

The order is not fixed. Rebuilding the broken config five times produced a working file once and a broken one four times, which is how this reached npm: the release build happened to land on the losing order.

Naming logger_factory as an entry in both blocks preserves its full export surface regardless of order. Verified stable over repeated builds.

smoke:entries imports every subpath in the exports map from the built output and fails when one will not load or exports nothing. It runs in release:verify:simplelog. Nothing already in place could have caught this: lint and typecheck read the source, and the generated otel.d.ts described the very export the JavaScript lacked, so the declaration agreed with the code that was never emitted. Only loading the built files shows it. Bisected: the new check fails on the unfixed build and passes on the fixed one.

Claude-Session: https://claude.ai/code/session_015zGgcXsDCDPNCSzhAWn1Zm

    SyntaxError: Export named 'setSpanContextReader' not found in module
      .../@murky-web/simplelog/dist/logger_factory.js

The build runs two tsdown config blocks, one `platform: "node"` and one
`platform: "neutral"`, writing to the same `outDir`. `logger_factory` was an
entry in neither, so each block emitted it keeping only the exports its own
entries used, and whichever finished last decided the file. The neutral block's
entries — deno, hono, web — never call `setSpanContextReader`, so when it won,
the export was gone and `dist/otel.js` imported a binding that did not exist.

The order is not fixed. Rebuilding the broken config five times produced a
working file once and a broken one four times, which is how this reached npm:
the release build happened to land on the losing order.

Naming `logger_factory` as an entry in both blocks preserves its full export
surface regardless of order. Verified stable over repeated builds.

`smoke:entries` imports every subpath in the `exports` map from the built
output and fails when one will not load or exports nothing. It runs in
`release:verify:simplelog`. Nothing already in place could have caught this:
lint and typecheck read the source, and the generated `otel.d.ts` described the
very export the JavaScript lacked, so the declaration agreed with the code that
was never emitted. Only loading the built files shows it. Bisected: the new
check fails on the unfixed build and passes on the fixed one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zGgcXsDCDPNCSzhAWn1Zm
@MurkyTheMurloc
MurkyTheMurloc merged commit 220c9ba into main Sep 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant