Open OsoThevenin opened 4 days ago
I managed to solve the issue by manually adding the env variable NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
in Vercel. How does exactly Vercel add this env variable? Because after successfully building the app project for the first time, I tried to remove the env variable and the build failed due to the same error.
Also, I want to point out that had to undo the command pnpm build
and use the turbo build
one (first time working with turbo 😅)
I can give a hand improving the documentation if it's the case. Thanks for your work 🫡
@OsoThevenin It should be added by Vercel on deploy: https://vercel.com/docs/projects/environment-variables/framework-environment-variables#NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL. Weird that it's not. I'll look into it.
Also experiencing this issue and cannot for the life of me figure out why. Currently it is not throwing the following:
app:build: ❌ Invalid environment variables: {
app:build: CLERK_SECRET_KEY: [ 'Required' ],
app:build: RESEND_AUDIENCE_ID: [ 'Required' ],
app:build: FLAGS_SECRET: [ 'Required' ]
app:build: }
Edit: Figured it out! Was not reading the warnings in the logs underneath the errors—oops. They were not in the turbo.json
file, but I can see that the most recent code does include them.
Thanks for the great work!
@coderreco Ah yes now I remember fixing that recently 😂
@OsoThevenin I'll ask the Vercel team about that error directly.
@coderreco Ah yes now I remember fixing that recently 😂
@OsoThevenin I'll ask the Vercel team about that error directly.
I actually did also experience the same error as originally reported. If I delete the NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
it will throw an error and stop the build. Have to add manually. Confirmed on both app
and web
🤷♂️
@OsoThevenin @coderreco are you folks pushing "production" Vercel deploys? I.e. is the branch you're pushing marked as the production branch in Vercel deployments?
@OsoThevenin @coderreco are you folks pushing "production" Vercel deploys? I.e. is the branch you're pushing marked as the production branch in Vercel deployments?
Yes, that's my case
Describe the bug I am deploying a clean version of next-forge in Vercel, and it fails due to env variables wrongly configured. The latest commit in my git is the result of running the init script.
next-forge version I am using version 2.14.15
To Reproduce
npx next-forge@latest init my-project
pnpm build
)/apps/app
I also tried to create a new project through the Vercel Marketplace but got the same result. Also tried to modify the build commands (see screenshot) because the default was
turbo build
Edit: Also executed thevercel link
to try to discard and tried to madeNEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
optional in case it was failing due to the first build.Expected behavior Expected to compile successfully
Screenshots Screenshot of the project configuration (app):
Screenshot of the error:
Desktop (please complete the following information):