这是indexloc提供的服务,不要输入任何密码
Skip to content

Turborepo doesn't always take defined environment variables into the hash #548

@leolabs

Description

@leolabs

What version of Turborepo are you using?

1.0.25

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

With a certain number of environment variables, Turborepo stops taking their value into the hash which leads to cache hits even when the environment variables have changed.

Demo video:

CleanShot.2022-01-12.at.13.55.33.mp4

Expected Behavior

When one of the environment variables changes, it should affect the calculated hash.

To Reproduce

Repro repo: https://github.com/leolabs/turborepo-env-repro

Config from package.json:

{
  "turbo": {
    "pipeline": {
      "build": {
        "dependsOn": [
          "^build"
        ],
        "outputs": [
          "dist/**",
          ".next/**"
        ]
      },
      "web-site#build": {
        "dependsOn": [
          "^build",
          "$NEXT_PUBLIC_CLIENT_ID",
          "$NEXT_PUBLIC_AUDIENCE",
          "$NEXT_PUBLIC_DOMAIN"
        ],
        "outputs": [
          "dist/**",
          ".next/**"
        ]
      },
      "lint": {
        "outputs": []
      },
      "dev": {
        "cache": false
      }
    }
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions