feat(config): add env validation utility#9
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/utils/envValidation.ts">
<violation number="1" location="src/utils/envValidation.ts:2">
P1: The new env validation utility is dead code because `validateEnv` is never called, so startup validation does not actually happen.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -0,0 +1,7 @@ | |||
| // Environment variable validation | |||
| export function validateEnv(): void { | |||
There was a problem hiding this comment.
P1: The new env validation utility is dead code because validateEnv is never called, so startup validation does not actually happen.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/utils/envValidation.ts, line 2:
<comment>The new env validation utility is dead code because `validateEnv` is never called, so startup validation does not actually happen.</comment>
<file context>
@@ -0,0 +1,7 @@
+// Environment variable validation
+export function validateEnv(): void {
+ const required = ['VITE_FIREBASE_API_KEY', 'VITE_FIREBASE_AUTH_DOMAIN', 'VITE_FIREBASE_PROJECT_ID'];
+ const missing = required.filter(key => !import.meta.env[key]);
</file context>
Validates required environment variables on app startup.
Summary by cubic
Adds a validateEnv utility that checks required Firebase Vite env vars at startup and logs a warning if any are missing. This helps catch misconfiguration early without blocking app boot.
Required keys: VITE_FIREBASE_API_KEY, VITE_FIREBASE_AUTH_DOMAIN, VITE_FIREBASE_PROJECT_ID.
Written for commit c1a2cac. Summary will update on new commits.