astriaai / headshots-starter

https://headshots-starter.vercel.app
MIT License
3.56k stars 575 forks source link

Issue with APP_WEBHOOK_SECRET Environment Variable Not Being Recognized During Build #105

Open JanusChoi opened 3 months ago

JanusChoi commented 3 months ago

Hello,

I am encountering an issue when deploying an application on Vercel, where the build process fails due to the APP_WEBHOOK_SECRET environment variable apparently not being recognized or found, despite being set.

Here's the error message I receive during deployment:

Error: MISSING APP_WEBHOOK_SECRET!
    at 46379 (/vercel/path0/.next/server/app/astria/prompt-webhook/route.js:1:1562)
    ...
> Build error occurred
Error: Failed to collect page data for /astria/prompt-webhook
    ...

I have confirmed that the APP_WEBHOOK_SECRET is a randomly generated string (in this case, "yousayitsarandomstring?") as suggested in the documentation/README, and I've made sure to set it correctly in the project settings on Vercel.

Here are the steps I've taken to troubleshoot without success:

  1. Double-checked that the environment variable is set in the Vercel project settings.
  2. Ensured that the variable is being correctly referenced in the code using process.env.APP_WEBHOOK_SECRET.
  3. Attempted to deploy with a simpler value for the environment variable to rule out issues with special characters.
  4. Reviewed the Vercel documentation and existing issues for any similar cases or additional configuration steps I might have missed.

I am wondering if there are any known issues with environment variable recognition during the build phase on Vercel, or if there are additional steps I need to take to ensure the environment variable is correctly passed and recognized by the build environment.

Any guidance or suggestions would be greatly appreciated.

Thank you!

fred3105 commented 3 months ago

Hey Janus,

I'm also having issues with Astria's callbacks, I would suggest double checking astria/train-model/route.ts and make sure that your callback url contains &webhook_secret=${appWebhookSecret}

If the url is correct, the problem likely comes from Astria. Are you using the mock environment for Astria or the production environment ?

suifeng8619 commented 1 week ago

You need to add the APP_WEBHOOK_SECRET and ASTRIA_API_KEY fields in the background