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
A lot of hydration warnings on a fresh run of the scaffold, suppressing the hydration warning didn't change anything. And this bug doesn't happen when deployed to vercel.
Reproduction repo
NA
To reproduce
Scaffold out the build (Prisma, authJS, tailwind)
Additional information
I believe this is happening due to the browser check when establishing the base URL. Compare the following:
function getBaseUrl() { if (typeof window !== "undefined") return ""; if (process.env.VERCEL_URL) return https://${process.env.VERCEL_URL}; return http://localhost:${process.env.PORT ?? 3000}; }
When I change the code to
function getBaseUrl() { if (document) return ""; if (process.env.VERCEL_URL) return https://${process.env.VERCEL_URL}; return http://localhost:${process.env.PORT ?? 3000}; }
The error clears up. Is there any downside to using document instead of type window to establish where the code is being executed?
The text was updated successfully, but these errors were encountered:
Provide environment information
"initVersion": "7.26.0"
Describe the bug
A lot of hydration warnings on a fresh run of the scaffold, suppressing the hydration warning didn't change anything. And this bug doesn't happen when deployed to vercel.
Reproduction repo
NA
To reproduce
Scaffold out the build (Prisma, authJS, tailwind)
Additional information
I believe this is happening due to the browser check when establishing the base URL. Compare the following:
function getBaseUrl() { if (typeof window !== "undefined") return ""; if (process.env.VERCEL_URL) return
https://${process.env.VERCEL_URL}; return
http://localhost:${process.env.PORT ?? 3000}; }
When I change the code to
function getBaseUrl() { if (document) return ""; if (process.env.VERCEL_URL) return
https://${process.env.VERCEL_URL}; return
http://localhost:${process.env.PORT ?? 3000}; }
The error clears up. Is there any downside to using document instead of type window to establish where the code is being executed?
The text was updated successfully, but these errors were encountered: