Skip to content

fix(api): inline @meldrank/rating into the api bundle - #18

Merged
JasonPaff merged 1 commit into
mainfrom
fix/api-rating-noexternal
Jul 7, 2026
Merged

JasonPaff merged 1 commit into
mainfrom
fix/api-rating-noexternal

Conversation

@JasonPaff

Copy link
Copy Markdown
Owner

Summary

  • apps/api/tsup.config.ts was missing @meldrank/rating from its noExternal list, so the Glicko-2 PR (Glicko 2 #16) left the import external in dist/index.js.
  • @meldrank/rating's package.json has no build output — main/exports point straight at ./src/index.ts, meant for bundler consumption only.
  • In production, the pruned node_modules resolved that raw .ts file directly, and Node refuses to type-strip anything under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), crash-looping meldrank-api at every boot since the v15 deploy (Jul 3, 22:22) — the API has been down for ~4 days.
  • This PR adds @meldrank/rating to the noExternal list so it's inlined like the other internal workspace packages.

Already hotfixed in prod: manually rebuilt and flyctl deployed meldrank-api with this fix ahead of this PR to restore service immediately. This PR lands the fix in git so future CD deploys don't regress.

Test plan

  • pnpm --filter @meldrank/api build locally, confirmed dist/index.js no longer references @meldrank/rating/src (fully inlined)
  • Manually deployed the fixed image to Fly; confirmed the machine reached started state (previously stuck crash-looping, hit max restart count)
  • Confirmed the tRPC batch endpoint that was previously timing out now responds correctly (401 unauthorized for an unauthenticated request, instead of a connection timeout)
  • CI quality gate (lint/typecheck/test/build)

🤖 Generated with Claude Code

Its package.json has no build output—main/exports point at raw
src/index.ts for bundler consumption only. Left external by tsup, the
pruned production node_modules resolved that .ts file directly and
Node refused to type-strip anything under node_modules
(ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), crash-looping
meldrank-api at boot since the Glicko-2 deploy (v15, Jul 3).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meld-rank-web Ready Ready Preview, Comment Jul 7, 2026 7:35pm

@JasonPaff
JasonPaff merged commit d6f8d0b into main Jul 7, 2026
4 checks passed
@JasonPaff
JasonPaff deleted the fix/api-rating-noexternal branch July 7, 2026 19:37
@JasonPaff
JasonPaff restored the fix/api-rating-noexternal branch July 10, 2026 02:03
@JasonPaff
JasonPaff deleted the fix/api-rating-noexternal branch July 10, 2026 02:06

This branch was successfully deployed

1 active deployment
Preview — e692d5cc Deployed Jul 7, 2026 by vercel[bot]
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