-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window [__ENV] not being set in Header Script - Next 14.2.3 #145
Comments
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.
|
@jimmyzzxhlh I think this is because of usage |
@KieranTH Hi! Since my PR #150 hasn't received a response, I've published my fork on npm. You can switch to awesome-next-runtime-env and be sure to configure the strategy prop for the assignment in your Root Layout:
For more information about the issue, check out: vercel/next.js#69567 (comment) |
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: