Issue Deploying Gemini AI Chatbot Template: POSTGRES_URL Not Defined

Hello Vercel Support Team,

I am encountering an issue while attempting to deploy the Gemini AI chatbot template. Despite having successfully deployed the Next.js AI chatbot template previously (which set up and connected both a Blob Store and a Postgres Database for the project), this time I am facing the following error message:

[10:35:11.505] āŒ Migration failed
[10:35:11.508] Error: POSTGRES_URL is not defined
[10:35:11.508]     at runMigrate (/vercel/path0/db/migrate.ts:12:11)
[10:35:11.508]     at postgres (/vercel/path0/db/migrate.ts:28:1)
[10:35:11.509]     at Object.<anonymous> (/vercel/path0/db/migrate.ts:32:2)
[10:35:11.509]     at Module._compile (node:internal/modules/cjs/loader:1469:14)
[10:35:11.509]     at Object.transformer (/vercel/path0/node_modules/.pnpm/tsx@4.19.1/node_modules/tsx/dist/register-DpmFHar1.cjs:2:1186)
[10:35:11.509]     at Module.load (node:internal/modules/cjs/loader:1288:32)
[10:35:11.509]     at Module._load (node:internal/modules/cjs/loader:1104:12)
[10:35:11.509]     at cjsLoader (node:internal/modules/esm/translators:346:17)
[10:35:11.509]     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
[10:35:11.510]     at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
[10:35:11.524]  ELIFECYCLE  Command failed with exit code 1.
[10:35:11.541] Error: Command "pnpm run build" exited with 1

It appears that POSTGRES_URL is not being defined during the deployment process, which prevents the migration from completing successfully. Since I have a Postgres Database already connected to the project, I’m uncertain why this variable is not being recognized.

Could you please assist me in troubleshooting and resolving this issue? Any guidance on ensuring that POSTGRES_URL is properly set during deployment would be greatly appreciated.

Thank you for your help!

Best regards.

the issue as been fixed, we added the option to install a Postgres database to the template

2 Likes