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
after I built my application in a docker container and run it there, I have problems while refreshing some pages.
I say some, because some pages can be reloaded, some pages not.
I've no idea why.
But the console message in my browser indicates that some variables in my auth provider are not set correctly. But I am very confused why.
It is caused by the env loading:
My provider:
"use client";importReact,{PropsWithChildren}from"react";import{AuthProvider}from"react-oidc-context";import{env}from"next-runtime-env";exportfunctionAuthProviderWrapper({ children }: PropsWithChildren){constNEXT_PUBLIC_AUTH_URL=env("NEXT_PUBLIC_AUTH_URL")??"";constNEXT_PUBLIC_AUTH_AUTHORITY_PATH=env("NEXT_PUBLIC_AUTH_AUTHORITY_PATH")??"";constNEXT_PUBLIC_AUTH_CLIENT_ID=env("NEXT_PUBLIC_AUTH_CLIENT_ID")??"";constNEXT_PUBLIC_AUTH_REDIRECT_URI=env("NEXT_PUBLIC_AUTH_REDIRECT_URI")??"";constoidcConfig={authority: NEXT_PUBLIC_AUTH_URL+NEXT_PUBLIC_AUTH_AUTHORITY_PATH,client_id: NEXT_PUBLIC_AUTH_CLIENT_ID,redirect_uri: NEXT_PUBLIC_AUTH_REDIRECT_URI,loadUserInfo: true,};return<AuthProvider{...oidcConfig}>{children}</AuthProvider>;}
I added some logging which says that after reload the page in the browser, my env("NEXT_PUBLIC_AUTH_URL") ?? ""(and all other calls) are evaluated to "" which causes my application to crash.
Only if I visit my main page (mydomain.de) everything is loaded fine again.
While navigation through the pages there is no issue.
Only on refresh the page. Maybe this is related with next-intl (???).
Does anybody has a hint how to fix that without removing the usage of next-runtime-env ?
T
The text was updated successfully, but these errors were encountered:
This is happening too for me - when I have my app deployed to Vercel sometimes on reload none of my runtime env vars are actually set - this disappears with a hard refresh, and sparingly with a regular refresh.
I'm not sure anymore but my problem was caused by some Wrapper in my layout.tsx which was on the wrong level.
After some cleanup there it worked again.
Hello,
after I built my application in a docker container and run it there, I have problems while refreshing some pages.
I say some, because some pages can be reloaded, some pages not.
I've no idea why.
But the console message in my browser indicates that some variables in my auth provider are not set correctly. But I am very confused why.
It is caused by the env loading:
My provider:
I added some logging which says that after reload the page in the browser, my
env("NEXT_PUBLIC_AUTH_URL") ?? ""
(and all other calls) are evaluated to "" which causes my application to crash.Only if I visit my main page (mydomain.de) everything is loaded fine again.
While navigation through the pages there is no issue.
Only on refresh the page. Maybe this is related with next-intl (???).
Does anybody has a hint how to fix that without removing the usage of next-runtime-env ?
T
The text was updated successfully, but these errors were encountered: