Skip to content

Production failure investigation#45

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/production-failure-investigation-f87f
Jan 31, 2026
Merged

Production failure investigation#45
kentcdodds merged 1 commit into
mainfrom
cursor/production-failure-investigation-f87f

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jan 31, 2026

Copy link
Copy Markdown
Member

Test Plan

  • export NODE_ENV="production" DATABASE_PATH="./prisma/sqlite.db" DATABASE_URL="file:./prisma/sqlite.db" CACHE_DATABASE_PATH="./other/cache.db" SESSION_SECRET="test-session-secret" INTERNAL_COMMAND_TOKEN="test-internal-token" HONEYPOT_SECRET="test-honeypot-secret" TWILIO_TOKEN="test-twilio-token" TWILIO_SID="test-twilio-sid" STRIPE_SECRET_KEY="test-stripe-secret" STRIPE_BASIC_PAYMENT_LINK="https://buy.stripe.com/test_basic" STRIPE_BASIC_PRODUCT="prod_test_basic" STRIPE_PREMIUM_PAYMENT_LINK="https://buy.stripe.com/test_premium" STRIPE_PREMIUM_PRODUCT="prod_test_premium" ALLOW_INDEXING="true"; node --input-type=module -e "import fs from 'fs'; const logPath = '/opt/cursor/artifacts/prod-start-test.log'; const lines = []; const log = (msg) => { lines.push(msg); console.log(msg); }; await import('./index.ts'); const delay = (ms) => new Promise((r) => setTimeout(r, ms)); await delay(2000); log('node_env ' + process.env.NODE_ENV); const res = await fetch('http://localhost:3000/'); log('status ' + res.status); await res.text(); fs.writeFileSync(logPath, lines.join('\n') + '\n'); process.exit(0);"
  • Ran a production boot + root request to verify the server starts and routes render in prod mode; no manual UI testing because there were no UI changes.

Checklist

  • Tests updated
  • Docs updated

Screenshots


Open in Cursor Open in Web


Note

Medium Risk
Changes production request routing/SSR wiring; a mismatch in the exported build module shape or middleware order could break all prod routes, but the change is small and localized.

Overview
Fixes production startup/request handling by changing the production branch in server/index.ts to import the generated server build module and app.use(buildModule.app).

This removes the @react-router/express createRequestHandler wiring (and its load context setup) that was incorrectly treating the server build as a React Router build, which could cause production failures.

Written by Cursor Bugbot for commit b16c24a. This will update automatically on new commits. Configure here.

Co-authored-by: me <me@kentcdodds.com>
@cursor

cursor Bot commented Jan 31, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@kentcdodds kentcdodds marked this pull request as ready for review January 31, 2026 06:58
@kentcdodds kentcdodds merged commit 657949e into main Jan 31, 2026
6 checks passed
@kentcdodds kentcdodds deleted the cursor/production-failure-investigation-f87f branch January 31, 2026 06:59
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.

2 participants