Skip to content

Brian B. Tung

Posts tagged #cjs

[EmDash] Why @atproto/api Caused exports is not defined in workerd and How pnpm Hoisting + ssr.optimizeDeps.include Fixes It

@atproto/api is CJS and lives only in pnpm's content-addressable store, so Vite's SSR optimizer can't find or convert it — meaning raw CJS reaches Cloudflare workerd, which has no exports global, and crashes. The fix requires both hoisting the package via publicHoistPattern and listing it in ssr.optimizeDeps.include.