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
Setting the env var APP_BASE_URL (or appBaseUrl in constructor) as a single value doesn't work for us. Locally, our ports increment if we have multiple UIs running and our PR Previews have different URLs.
Describe the ideal solution
Make it dynamic somehow
Alternatives and current workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
This issue is causing problems for our development on Vercel, a major platform for Next.js.
Specifically, it prevents us from using one of Vercel’s signature features—creating a preview environment (with a dynamically issued URL) for each pull request—which is why we, too, hope this functionality will be added.
You can set dynamic environment variables in nextjs via next.config.mjs
We solve this exact use case via:
constisPreviewDeploy=()=>{return(process.env.VERCEL_ENV==="preview"&&process.env.VERCEL_GIT_COMMIT_REF!=="dev"&&process.env.VERCEL_GIT_COMMIT_REF!=="staging"&&process.env.VERCEL_GIT_COMMIT_REF!=="qa"&&process.env.VERCEL_GIT_COMMIT_REF!=="uat");};/** @type {import('next').NextConfig} */constnextConfig={env: {// AUTH0_BASE_URL needs to be set dynamically in preview deploysAPP_BASE_URL: isPreviewDeploy()
? `https://${process.env.VERCEL_BRANCH_URL}`
: process.env.APP_BASE_URL,},};
...
Checklist
Describe the problem you'd like to have solved
Setting the env var
APP_BASE_URL
(orappBaseUrl
in constructor) as a single value doesn't work for us. Locally, our ports increment if we have multiple UIs running and our PR Previews have different URLs.Describe the ideal solution
Make it dynamic somehow
Alternatives and current workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: