fix(packages): reorder exports conditions to fix API crash #52

Merged
ghost merged 1 commits from fix/db-exports-condition-order into main 2026-03-18 19:47:33 +00:00
ghost commented 2026-03-18 19:44:40 +00:00 (Migrated from github.com)

Summary

  • Reorders exports conditions in packages/db/package.json and packages/types/package.json so default comes before types
  • Fixes the API container CrashLoopBackOff caused by Node.js v20.20.1 matching the types export condition and attempting to load .ts source files at runtime (ERR_UNKNOWN_FILE_EXTENSION)
  • TypeScript resolution is unaffected since it explicitly seeks the types condition regardless of key order

Root Cause

The API pod (api-5978bb6f64-jg5g7) is in CrashLoopBackOff with 9+ restarts. Pod logs show:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/packages/db/src/index.ts

Node.js is resolving @groombook/db via the types export condition (./src/index.ts) instead of default (./dist/index.js). By reordering conditions so default appears first, Node.js matches it immediately.

Test plan

  • CI passes (lint, typecheck, test, build)
  • After merge + image rebuild, verify API pod starts without CrashLoopBackOff
  • Verify pnpm dev still works locally with correct TypeScript resolution

🤖 Generated with Claude Code

## Summary - Reorders `exports` conditions in `packages/db/package.json` and `packages/types/package.json` so `default` comes before `types` - Fixes the API container CrashLoopBackOff caused by Node.js v20.20.1 matching the `types` export condition and attempting to load `.ts` source files at runtime (`ERR_UNKNOWN_FILE_EXTENSION`) - TypeScript resolution is unaffected since it explicitly seeks the `types` condition regardless of key order ## Root Cause The API pod (`api-5978bb6f64-jg5g7`) is in CrashLoopBackOff with 9+ restarts. Pod logs show: ``` TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/packages/db/src/index.ts ``` Node.js is resolving `@groombook/db` via the `types` export condition (`./src/index.ts`) instead of `default` (`./dist/index.js`). By reordering conditions so `default` appears first, Node.js matches it immediately. ## Test plan - [ ] CI passes (lint, typecheck, test, build) - [ ] After merge + image rebuild, verify API pod starts without CrashLoopBackOff - [ ] Verify `pnpm dev` still works locally with correct TypeScript resolution 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This repo is archived. You cannot comment on pull requests.