Skip to content

Node ESM import fix (#88): db 0.7.2, storage 0.4.1, auth 0.7.5 - #89

Merged
clibequilibrium merged 3 commits into
mainfrom
preview
Nov 15, 2026
Merged

clibequilibrium merged 3 commits into
mainfrom
preview

Conversation

@clibequilibrium

Copy link
Copy Markdown
Member

Fixes #88.

@frostbase-dev/db/client, db/admin and storage/client threw ERR_MODULE_NOT_FOUND in plain Node: the agents compiled with moduleResolution: node, emitting extensionless relative imports that Node's ESM resolver rejects.

  • Agents now build with nodenext (like the CLI); all relative imports carry .js, and the per-agent typecheck in CI rejects an extensionless one.
  • Verified by packing all three packages into a clean consumer and importing every Node-facing subpath; unit tests and Wrangler bundles unchanged.
  • Bumps db 0.7.2, storage 0.4.1, auth 0.7.5 so the release workflow publishes them.

🤖 Generated with Claude Code

Importing @frostbase-dev/db/client or /admin, or @frostbase-dev/storage/client,
in Node without a bundler threw ERR_MODULE_NOT_FOUND (issue #88). The packages
are "type": "module", but the agents compiled with module es2022 +
moduleResolution node, so tsc emitted extensionless relative specifiers
('./schemas') that Node's ESM resolver refuses. Wrangler and every bundler
paper over that, which is why nothing in our stack noticed; the README's
server example was simply broken. auth/admin, db/drizzle and storage/admin only
loaded by luck - no relative runtime imports.

All three agents now build with nodenext, like the CLI, and every relative
import carries its .js extension. nodenext makes tsc reject an extensionless
import (TS2835), so the quality job's per-agent typecheck now guards this.
tsx (unit tests) and wrangler's esbuild both map .js to .ts, so dev, tests and
the Worker bundles are unchanged.

Verified by packing all three packages into a clean consumer and importing
every Node-facing subpath.

Fixes #88
So the extensions added for #88 do not read as noise someone tidies away.
Ships the Node ESM import fix (#88): db/client, db/admin and storage/client
threw ERR_MODULE_NOT_FOUND outside a bundler. Auth carries the same
extension change, so it ships too to keep its published files matching source.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
frostbase-dev-preview 58b6600 Nov 15 2026, 04:58 PM

@clibequilibrium
clibequilibrium merged commit a8ca8d4 into main Nov 15, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
preview — 58b6600e Deployed Nov 15, 2026 by clibequilibrium via Deploy Preview #108
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.

@frostbase-dev/db: ./client and ./admin fail to import in Node.js (ERR_MODULE_NOT_FOUND)

1 participant