also looking at this
fix(buddy): don't let optional rpx HTTPS preflight crash dev server
#3
1 file
+9
-0
| @@ -369,6 +369,14 @@ export async function startDevelopmentServer(_options: DevOptions, _startTime?: | ||
| 369 | 369 | const rpxTlsPreflight = hasCustomDomain && domain |
| 370 | 370 | ? prepareRpxTlsForDev({ domain, includeDashboard, options }) |
| 371 | 371 | : 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(() => {}) | |
| 372 | 380 | |
| 373 | 381 | // Clean up child processes on exit to prevent orphaned processes. |
| 374 | 382 | // |
| @@ -482,6 +490,7 @@ export async function startDevelopmentServer(_options: DevOptions, _startTime?: | ||
| 482 | 490 | catch (error) { |
| 483 | 491 | const message = error instanceof Error ? error.message : String(error) |
| 484 | 492 | console.log(` ${yellow('⚠')} ${yellow('HTTPS proxy unavailable')}: ${message}`) |
| 493 | console.log(` ${dim(' ')}${dim(`Use http://localhost:${frontendPort} (API http://localhost:${apiPort})`)}`) | |
| 485 | 494 | if (options.verbose) { |
| 486 | 495 | console.log(` ${dim(' ')}${dim('Set SUDO_PASSWORD in .env and restart `./buddy dev`')}`) |
| 487 | 496 | console.log(` ${dim(' ')}${dim(`Trust CA: sh ${join(RPX_SSL_DIR, 'trust-rpx-cert.sh')}`)}`) |