Repository navigation
fix(frontend): stop missing NEXT_PUBLIC_CONTRACT_ID from crashing every page - #1581
Merged
mimijuwonlo-commits merged 2 commits intoOct 27, 2026
Merged
Conversation
…ry page The production schema required NEXT_PUBLIC_CONTRACT_ID and validateEnv() threw when it was absent. That check runs in the browser at bundle load (NODE_ENV is "production" there), not only at build time, so a deployment without the variable crashed every route, including the public landing page. No frontend code signs against this value; transactions are built by the backend from its own CONTRACT_ID. A missing or empty value now warns instead of throwing. A malformed value still throws. The production-throw test is replaced with one asserting the new behaviour, plus tests for the empty and malformed cases. Also drop the root optionalDependencies pin on lightningcss-win32-x64-msvc ^1.33.0. It did not match the lightningcss 1.32.0 that Tailwind uses, so it installed an unused Windows binary at a second version. The correct 1.32.0 Windows and Linux binaries remain in the lockfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Godsmiracle001 is attempting to deploy a commit to the mimijuwonlo-8913's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Deployments without
NEXT_PUBLIC_CONTRACT_IDcrash every route in the browser, including the public landing page:validateEnv()required the variable wheneverNODE_ENV === "production". That check runs when the browser loads the bundle, not only at build time. No frontend code signs against this value; transactions are built by the backend from its ownCONTRACT_ID.Change
NEXT_PUBLIC_CONTRACT_IDnow logs a warning instead of throwing. A malformed value still throws.optionalDependenciespin onlightningcss-win32-x64-msvc@^1.33.0. It did not match thelightningcss@1.32.0that Tailwind uses. The 1.32.0 Windows and Linux binaries remain in the lockfile..env.examplethat the contract ID is optional and that the API URL must be public in deployments.Verification
env.test.tsanduseNetworkGuard.test.ts: 25/25 pass.next buildwithNEXT_PUBLIC_CONTRACT_IDunset succeeds and prints the warning.🤖 Generated with Claude Code