Repository navigation
fix(cli): keep env validation out of browser bundles - #1164
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
💤 Files with no reviewable changes (3)
WalkthroughChangesDocker validation and frontend variables
Possibly related PRs
Mergeability Score: ⚪ Minimal · up to The PR keeps environment validation out of browser bundles while preserving the required server-side Docker behavior, with no actionable merge-blocking risk remaining after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8e54471e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {{/if}} | ||
| {{/if}} | ||
| skipValidation: !!process.env.SKIP_ENV_VALIDATION, | ||
| emptyStringAsUndefined: true, |
There was a problem hiding this comment.
Pass the Convex site URL into Docker builds
When Docker deployment is selected with Convex, Better Auth, and any supported React frontend, web env validation requires NEXT_PUBLIC_CONVEX_SITE_URL or VITE_CONVEX_SITE_URL, but the Compose template and corresponding Dockerfiles pass only the Convex cloud URL. Now that validation is no longer skipped, docker compose build deterministically fails for these configurations; add the site URL to the generated root Compose variables, build arguments, and Dockerfile ARG/ENV declarations.
Useful? React with 👍 / 👎.
| context: . | ||
| dockerfile: apps/web/Dockerfile | ||
| {{#if (and (not (includes frontend "nuxt")) (or (and (ne backend "self") (ne backend "none") (ne backend "convex")) (eq backend "convex") (and (eq auth "clerk") (or (includes frontend "next") (includes frontend "react-router") (includes frontend "tanstack-router") (includes frontend "tanstack-start")))))}} | ||
| {{#if (or (and (ne backend "self") (ne backend "none") (ne backend "convex")) (eq backend "convex") (and (eq auth "clerk") (or (includes frontend "next") (includes frontend "react-router") (includes frontend "tanstack-router") (includes frontend "tanstack-start"))))}} |
There was a problem hiding this comment.
Pass the Nuxt-prefixed Convex URL to the image
For frontend: nuxt, backend: convex, and webDeploy: docker, this widened condition now creates an args block, but the Convex branch emits VITE_CONVEX_URL while the Nuxt config validates NUXT_PUBLIC_CONVEX_URL; the Nuxt Dockerfile also has no corresponding Convex ARG/ENV. Because per-app .env files are excluded from the build context and validation is no longer bypassed, this supported image cannot build even when the intended Nuxt variable is configured. Add a Nuxt-specific Convex argument throughout Compose, the Dockerfile, and root build-argument env generation.
Useful? React with 👍 / 👎.
Summary
SKIP_ENV_VALIDATIONfrom generated browser environment modulesNUXT_PUBLIC_SERVER_URLas a Docker build argument so Nuxt public env remains validatedRoot cause
The shared browser env module read
process.env.SKIP_ENV_VALIDATION. Vite shipped that expression to the browser, whereprocessis unavailable, so SolidStart hydration crashed before the API status query could run.Self-hosted SSR images still need the documented t3-env build bypass because their server modules are evaluated while building, before runtime secrets are injected. The bypass now stays in that server build context and is never referenced by browser code.
Verification
bun run checkbun run buildSummary by CodeRabbit
Bug Fixes
Documentation