Skip to content

fix(sdk): correct exports to .mjs/.d.mts and build adapter entries - #2

Merged
jaredLunde merged 1 commit into
mainfrom
fix/sdk-exports-mjs
Jun 20, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
fix/sdk-exports-mjs

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Problem

@beyond.dev/auth's exports map points at ./dist/index.js / ./dist/index.d.ts, but the tsdown build (format: "esm", "type": "module") emits index.mjs / index.d.mts. ESM bundlers (Vite SSR in a TanStack Start app) fail with "Failed to resolve entry for package @beyond.dev/auth".

Separately, the exports map declares ./server, ./hono, ./fastify, ./express, but the tsdown entry never built them — those subpaths don't exist in dist/.

Fix

  • Point every exports target at the real .mjs / .d.mts output (consistent with @beyond.dev/kv/queue/objects).
  • Add server/index, hono/index, fastify/index, express/index to the tsdown entry so the declared subpath exports actually build.

Verified by building the SDK and resolving @beyond.dev/auth + @beyond.dev/auth/server from a TanStack Start SSR build.

🤖 Generated with Claude Code

…l adapter entries

The exports map pointed at ./dist/*.js + .d.ts, but tsdown (format: esm,
type: module) emits .mjs/.d.mts — so ESM bundlers (e.g. Vite SSR) failed to
resolve @beyond.dev/auth. Also adds server/hono/fastify/express to the tsdown
entry so the ./server, ./hono, ./fastify, ./express exports actually build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jaredLunde
jaredLunde merged commit 2d9069e into main Jun 20, 2026
2 of 6 checks passed
@jaredLunde
jaredLunde deleted the fix/sdk-exports-mjs branch June 20, 2026 18:54
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