ReviewOS

also looking at this

stacks/postline

fix(buddy): don't let optional rpx HTTPS preflight crash dev server

#3
Merged chris wants to merge fix/buddy-dev-rpx-crash into main
1 file +9 -0
storage/framework/core/buddy/src/commands/dev.tsmodified+9-0
Changes to storage/framework/core/buddy/src/commands/dev.ts
@@ -369,6 +369,14 @@ export async function startDevelopmentServer(_options: DevOptions, _startTime?:
369369 const rpxTlsPreflight = hasCustomDomain && domain
370370 ? prepareRpxTlsForDev({ domain, includeDashboard, options })
371371 : Promise.resolve()
372 // The HTTPS proxy is optional. This preflight is only awaited later (inside the
373 // readiness handler, behind the frontend port probe), so without a handler
374 // attached now an early failure — e.g. an @stacksjs/rpx build that predates the
375 // TLS helpers `ensureRpxDevelopmentHttps` calls — would surface as an unhandled
376 // rejection and kill the dev server before the frontend even binds. Attaching a
377 // no-op catch keeps the rejection "handled"; the real await below still reports
378 // it as a warning and the dev server degrades to http://localhost.
379 void rpxTlsPreflight.catch(() => {})
372380
373381 // Clean up child processes on exit to prevent orphaned processes.
374382 //
@@ -482,6 +490,7 @@ export async function startDevelopmentServer(_options: DevOptions, _startTime?:
482490 catch (error) {
483491 const message = error instanceof Error ? error.message : String(error)
484492 console.log(` ${yellow('⚠')} ${yellow('HTTPS proxy unavailable')}: ${message}`)
493 console.log(` ${dim(' ')}${dim(`Use http://localhost:${frontendPort} (API http://localhost:${apiPort})`)}`)
485494 if (options.verbose) {
486495 console.log(` ${dim(' ')}${dim('Set SUDO_PASSWORD in .env and restart `./buddy dev`')}`)
487496 console.log(` ${dim(' ')}${dim(`Trust CA: sh ${join(RPX_SSL_DIR, 'trust-rpx-cert.sh')}`)}`)