fix: add missing env vars to docker-compose and fix Greeting hydration bug#1922
Open
anupborker wants to merge 1 commit intocode100x:mainfrom
Open
fix: add missing env vars to docker-compose and fix Greeting hydration bug#1922anupborker wants to merge 1 commit intocode100x:mainfrom
anupborker wants to merge 1 commit intocode100x:mainfrom
Conversation
…n bug - Add NEXTAUTH_SECRET, NEXTAUTH_URL, JWT_SECRET, ADMIN_SECRET, LOCAL_CMS_PROVIDER to docker-compose.yml so login works out of the box - Fix hydration mismatch in Greeting.tsx by deferring time-based greeting to useEffect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
What does this PR do?
docker-compose.ymlso the app works out of the box without manual.enveditsGreeting.tsxcaused by time-based greeting differing between server and client renderChanges
docker-compose.yml
LOCAL_CMS_PROVIDER,NEXTAUTH_URL,NEXTAUTH_SECRET,JWT_SECRET,ADMIN_SECRETto the environment blockNEXT_PUBLIC_BASE_URL_LOCALso API calls resolve correctly inside the containersrc/components/Greeting.tsx
useEffectwithuseState('')initial valueWhy?
Without these env vars, Docker login would fail with
TypeError: Failed to parse URL from undefined/post/userLogin. New contributors had no way to know which vars were missing since onlyDATABASE_URLwas passed to the container.The Greeting hydration bug caused the entire root to switch to client rendering, flooding the console with errors on every page load.
Checklist before requesting a review