Skip to content

Error in nextjs while making build #138358

Discussion options

You must be logged in to vote

The error you're encountering is primarily due to using Firebase's Remote Config in a server environment, where the window object isn't available. Firebase Remote Config is meant to be used on the client side, as it's dependent on browser-specific objects like window.

Steps to Fix:
Ensure Remote Config Runs Only on the Client-Side: You need to wrap your Firebase Remote Config logic inside a useEffect hook or conditionally check for the existence of window to ensure it's only executed in the client environment.
Resolve Prerendering Errors for Static Pages: Since Next.js is attempting to prerender pages like /, _not-found, and /privacypolicy, and these pages are failing due to the same wind…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ayushkodari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
2 participants