Back to Turborepo

Package task in single-package workspace error

apps/docs/content/docs/messages/package-task-in-single-package-workspace.mdx

2.9.14626 B
Original Source

Why this error occurred

In single package mode, there cannot be multiple packages in your repository. Therefore, declaring a task in the turbo.json with a specified package name is not permitted.

json
{
  "tasks": {
    "app#build": {
      "cache": true
    }
  }
}

Solution

Remove the package name from the task declaration.

json
{
  "tasks": {
    "build": {
      "cache": true
    }
  }
}

Alternatively, if you would like to have multiple packages, you can specify the workspaces in your repository.