Skip to content

improve(dx): clarify missing STELLAR_SERVER_SECRET error#369

Merged
vic-Gray merged 2 commits into
code-flexing:mainfrom
Depo-dev:improve/stellar-secret-error-316
May 29, 2026
Merged

improve(dx): clarify missing STELLAR_SERVER_SECRET error#369
vic-Gray merged 2 commits into
code-flexing:mainfrom
Depo-dev:improve/stellar-secret-error-316

Conversation

@Depo-dev
Copy link
Copy Markdown
Contributor

Summary

The startup error thrown when STELLAR_SERVER_SECRET is missing was too vague for contributors to act on. It didn't name the variable clearly, didn't explain why it was needed, and gave no hint about where to configure it.

Previous Issue

Error: STELLAR_SERVER_SECRET environment variable is required

This message forces contributors to search the codebase to understand what STELLAR_SERVER_SECRET is, where to get a value, and which config file to update — a slow and frustrating onboarding experience.

New Developer Guidance Behavior

Error: Missing required environment variable: STELLAR_SERVER_SECRET.
Please define it in your .env file before starting the server.

The new message:

  • Names the exact missing variable
  • States that it is required (not optional)
  • Tells contributors exactly where to configure it (.env file)
  • Matches the actionable tone of similar guidance in the project docs

The server still fails to start when STELLAR_SERVER_SECRET is absent — only the diagnostic message improves. Exception type (Error) and throw location (constructor) are unchanged.

Validation Performed

  • Server startup with STELLAR_SERVER_SECRET unset: new message appears correctly
  • Server startup with STELLAR_SERVER_SECRET set: no change in behavior
  • stellar.strategy.spec.ts updated to assert the new message text

Also applies the pre-existing build fix: explicit User | null annotation on the resetPassword loop accumulator in auth.service.ts (was causing TS2322 under strictNullChecks).

  • npx jest src/auth/strategies/stellar.strategy.spec.ts — 18/18 passing
  • npm run build — clean

Fixes #316
Fixes #613

Replace the generic startup error for a missing STELLAR_SERVER_SECRET
with an actionable message that names the exact variable, explains
what is needed, and tells contributors where to configure it.

Before:
  'STELLAR_SERVER_SECRET environment variable is required'

After:
  'Missing required environment variable: STELLAR_SERVER_SECRET.
   Please define it in your .env file before starting the server.'

The server still fails to start when the variable is absent — only
the diagnostic message improves. This matches the developer-facing
guidance style used across the onboarding docs and makes it faster
for contributors to fix local setup issues.

Also apply explicit User | null type annotation to auth.service.ts
to resolve a pre-existing build error (let user = null without type
annotation caused TS2322 under strictNullChecks).

Fixes code-flexing#316
Fixes #613
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@Depo-dev is attempting to deploy a commit to the vic's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Depo-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vic-Gray vic-Gray merged commit bdf309a into code-flexing:main May 29, 2026
1 of 8 checks passed
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.

#613 Improve error message for missing STELLAR_SERVER_SECRET

2 participants