Skip to content

fix: keep the root barrel edge-safe (1.2.1) - #60

Merged
vreshch merged 1 commit into
masterfrom
fix/edge-safe-barrel
Sep 20, 2026
Merged

vreshch merged 1 commit into
masterfrom
fix/edge-safe-barrel

Conversation

@vreshch

@vreshch vreshch commented Sep 20, 2026

Copy link
Copy Markdown
Member

Why

1.1.0 added serveHealth to the root barrel with a static import ... from 'node:http'. Next bundles instrumentation.ts for the edge runtime whenever a middleware exists, and both admin and dashboard import log from the root barrel there. On the edge runtime node:http does not exist, so the middleware chunk throws at module evaluation and every non-/health request 500s. Friday's dependabot bump (^1.0.0 -> ^1.1.0) took admin.agentage.io and dashboard.agentage.io down.

What

  • serve-health.ts: type-only import; createServer comes from process.getBuiltinModule('node:http') inside serveHealth, so the barrel loads anywhere and the builtin is only touched when a worker actually calls it. Node >=22.13 is already the engine floor.
  • test/unit/edge-safe-barrel.test.ts: walks the static import graph from src/index.ts and fails on any node: builtin the edge runtime lacks (async_hooks and events allow-listed). Guards against the next barrel addition doing this again.
  • Version 1.2.1.

Verified

npm run verify green: 441 tests, dist/bootstrap/stdio smokes. Follow-up PRs bump admin + dashboard to 1.2.1.

@vreshch
vreshch marked this pull request as ready for review September 20, 2026 23:27
@vreshch
vreshch merged commit 7c7c615 into master Sep 20, 2026
1 check passed
@vreshch
vreshch deleted the fix/edge-safe-barrel branch September 20, 2026 23:27
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