Demo, all content is generated
Share
Fail the boot when an environment variable is missing
A missing variable used to surface as a 500 on one page in production. Now the app refuses to start and names the variable. Import this from your root layout so it runs on every server boot. Any validator works, zod is just what I had.
Same pattern in every app I ship. Fail loudly at boot. jonas_k · edited
Tweak I made: a separate schema for the NEXT_PUBLIC_ ones in the client, so the server-only keys never get referenced from client code. ximena_c · edited