[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Vercel build using turborepo is failing saying the env variable RESEND_API_KEY does not exist, but it does

183 views · 1 like · 3 posts


James Singleton (@jamesrsingleton) · 2024-07-26

All builds work fine locally, this build worked fine 24 days ago on Vercel until I updated depends. None of the deps updated touched resend. I don't really know any other way to contact support for help.

```json
{
  "$schema": "https://turbo.build/schema.json",
  "globalDependencies": ["**/.env.*local"],
  "tasks": {
    "build": {
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "dependsOn": ["^build"],
      "outputs": [".next/**", "!.next/cache/**"]
    },
    "lint": {
      "dependsOn": ["^lint"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

```

This is what the `turbo.json` looks like and I have a `packages/*` as well as an `apps/*`. Running `pnpm build` locally works for all my projects.


Chris Olszewski (@olszewski) · 2024-07-26 · ♥ 1

If the update to dependencies included an update from turbo 1.x to 2, then [strict environment mode](https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#strict-mode) is enabled by default. Declaring `RESEND_API_KEY` as a pass through [env variable](https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#passthrough-variables) or switching back to using [loose env mode](https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#loose-mode) should solve the problem.

I would suggest reading over the [upgrade guide for 2.0](https://turbo.build/repo/docs/crafting-your-repository/upgrading) for an overview of all the breaking changes that happened.


James Singleton (@jamesrsingleton) · 2024-07-26

Yea it feels weird to have to specify an ENV that is used in one app/* in the build task that is used for EVERY app and package