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
Not 100% sure if it is related, but I'm getting a warning in the console like the following. My environment variables are injected into client side components correctly though.
I'm using Next 14.2.5, next-runtime-env 3.2.2.
app-index.js:33 Warning: Prop `dangerouslySetInnerHTML` did not match. Server: "(self.__next_s=self.__next_s||[]).push([0,{\"children\":\"window['__ENV'] = {\\\"NEXT_PUBLIC_APP_ENVIRONMENT\\\":\\\"production\\\"}\"}])" Client: "(self.__next_s=self.__next_s||[]).push([0,{\"children\":\"window['__ENV'] = {}\"}])"
at script
at Script (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/script.js:180:13)
at EnvScript (webpack-internal:///(app-pages-browser)/./node_modules/next-runtime-env/build/script/env-script.js:23:22)
at PublicEnvScript (webpack-internal:///(app-pages-browser)/./node_modules/next-runtime-env/build/script/public-env-script.js:22:28)
at head
Issue
I recently discovered an issue with my Next Env Variables, where it seems only SSR Components are able to access runtime variables.
After some debugging, it seems although the issue is coming from the
<Script/>
component from Next.The above code will fail due to the
beforeInteractive
strategy. If it's set toafterInteractive
the window will be updated as expected.It seems although
beforeInteractive
causes the script to not run at all in the client.Anyone else ever encountered a similar issue?
The text was updated successfully, but these errors were encountered: