Title: bug: syncVercelEnvVars syncs production env var for preview deployment when using NeonDB vercel integration · Issue #2714 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: bug: syncVercelEnvVars syncs production env var for preview deployment when using NeonDB vercel integration · Issue #2714 · triggerdotdev/trigger.dev
X Title: bug: syncVercelEnvVars syncs production env var for preview deployment when using NeonDB vercel integration · Issue #2714 · triggerdotdev/trigger.dev
Description: Provide environment information (Version is 4.1.2, but likely does not matter much) Describe the bug When using the Vercel NeonDB integration, each preview environments gets individual env vars set just before a build starts on Vercel. T...
Open Graph Description: Provide environment information (Version is 4.1.2, but likely does not matter much) Describe the bug When using the Vercel NeonDB integration, each preview environments gets individual env vars set...
X Description: Provide environment information (Version is 4.1.2, but likely does not matter much) Describe the bug When using the Vercel NeonDB integration, each preview environments gets individual env vars set...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/2714
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: syncVercelEnvVars syncs production env var for preview deployment when using NeonDB vercel integration","articleBody":"### Provide environment information\n\n(Version is 4.1.2, but likely does not matter much)\n\n### Describe the bug\n\nWhen using the Vercel NeonDB integration, each preview environments gets individual env vars set just before a build starts on Vercel. Those \"per preview environment\" env vars are **not returned by the Vercel REST API** at `https://api.vercel.com/v8/projects/${projectId}/env?${params}`.\n\nThe problem is that syncVercelEnvVars uses the above URL to get both, env var names and their values. The synced env vars do not have the values Vercel uses during the build! Env var are not actually in sync.\n\nTo make matters worse, the Vercel NeonDB integration, automatically makes the production db env var available through the above REST API _for the staging environment_! This caused our trigger.dev staging environment to write to our prod db :( (In the Vercel UI this env var is \"managed\" by the Neon DB integration and cannot even be manually fixed.)\n\nMy suggestion is to \"fix\" this problem by modifying syncVercelEnvVars to only get the names of the env vars from the REST API but then _reading the values from the actual build environment_. Just like \"syncEnvVars\" does it.\n\n(For what it's worth, follow-ups could also include:\n1. To file a feature request with Vercel to ask for a way to get the \"per preview environment\" env vars.\n2. To ask NeonDB to not set the prod url for staging [tbh wtf])\n\nAs a workaround, we switched to using \"syncEnvVars\" for the Neon related env vars.\n\n### Reproduction repo\n\nSorry, I hope the steps are detailed enough\n\n### To reproduce\n\n- Make a Vercel project\n- Use the Neon db Vercel integration\n- Build/deploy a Vercel preview environment that also deploys to trigger.dev staging env and uses syncVercelEnvVars\n- Observe that the trigger dev tasks in staging are using the production database\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/felix-quotez","@type":"Person","name":"felix-quotez"},"datePublished":"2025-11-28T12:07:45Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/2714"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:974814bd-508b-390e-f36c-d4e315888896 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB82:1E24B0:37E2E2:53720F:6AFAE241 |
| html-safe-nonce | 074bfccadd4db76d924e4ccdb039c6a4d09038cb0a2a3a62d5a73647b3d4f6ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjgyOjFFMjRCMDozN0UyRTI6NTM3MjBGOjZBRkFFMjQxIiwidmlzaXRvcl9pZCI6IjMxMTYxNTU4NTQ4ODE3NDM0MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4c85bc4e5e8dde53eaf6d30b8b812bc097da4717720284ecc576acc2da475967 |
| hovercard-subject-tag | issue:3674688446 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/2714/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a7ebb6bf3e53bf90ffb5f38ecd4aedeb765685aaa6614631f492312d47f81dc/triggerdotdev/trigger.dev/issues/2714 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a7ebb6bf3e53bf90ffb5f38ecd4aedeb765685aaa6614631f492312d47f81dc/triggerdotdev/trigger.dev/issues/2714 |
| og:image:alt | Provide environment information (Version is 4.1.2, but likely does not matter much) Describe the bug When using the Vercel NeonDB integration, each preview environments gets individual env vars set... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | felix-quotez |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a7ae932999cc6d511008dbf980ff9efad2a31f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width