You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a page defaults to the not-found page client components fail to load the environment variables (all NEXT_PUBLIC) are undefined while on the server they have the correct values.
This is happening in all 3.X versions I tried and with Nextjs app router v14
The text was updated successfully, but these errors were encountered:
Even if the not-found component is server-side, after the redirect to the page, the entire window.__ENV becomes undefined, and env("ENV_KEY") also becomes undefined.
fixes with changing router.push() to window.location.href
without page refresh it works as expected
Issue
When a page defaults to the not-found page client components fail to load the environment variables (all NEXT_PUBLIC) are undefined while on the server they have the correct values.
This is happening in all 3.X versions I tried and with Nextjs app router v14
The text was updated successfully, but these errors were encountered: