turbo: [turborepo] Error while trying to run script with filter when filter eliminates all possible workspaces

What version of Turborepo are you using?

1.8.2

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

pnpm

What operating system are you using?

Mac

Describe the Bug

In my project, if I’m sitting in the main branch with a clean working copy and I try to run:

turbo --filter "[main]" lint

I get the following output

• Packages in scope: 
• Running lint in 0 packages
• Remote caching disabled

No tasks were executed as part of this run.

 Tasks:    0 successful, 0 total
Cached:    0 cached, 0 total
  Time:    66ms 

However, if I make a modification to a file in my monorepo’s root that is not inside a specific package, and is not an input to any package, such as .gitignore, then I get the following output:

 ERROR  run failed: error preparing engine: Could not find the following tasks in project: lint
Turbo error: error preparing engine: Could not find the following tasks in project: lint

Expected Behavior

I should not be getting this error, and turbo should instead simply run no tasks.

To Reproduce

In a monorepo with turborepo, checkout main/master with a clean working copy, then modify the project’s .gitignore and try running turbo --filter "[{branch}]" {script} where {branch} is your main/master branch and {script} is any script configured in the turbo.json pipelines.

I just tested and this can be replicated using the starter monorepo created via npx create-turbo@latest

Reproduction Repo

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 16 (7 by maintainers)

Most upvoted comments

This issue can be resolved by downgrading the version to 1.10.4.

It’s not an ideal solution.

Thanks for the reporting @trappar and @tkstang! I was able to reproduce and the fix issue in #3951. We should hopefully get a new patch release out shortly (this issue will probably close on merge). The explanation for the bug is essentially the same as in https://github.com/vercel/turbo/issues/3896#issuecomment-1439193366. Apologies for the inconvenience!

@Tittoh good catch. Could you file a new issue to update the docs? If you don’t get to it I’ll make a note to do this on Monday! The error message did indeed change

Just an update: we released 1.8.3 with the fix: https://github.com/vercel/turbo/releases/tag/v1.8.3

Ah, my fault @trappar, sorry about that! We’ll take a look.

Oops, sorry I was mistaken in the bug report. I’m actually already on 1.8.2, and it’s still occurring. I’ll update my original issue to reflect that.

% turbo --version             
1.8.2
% turbo --filter "[main]" lint
 ERROR  run failed: error preparing engine: Could not find the following tasks in project: lint
Turbo error: error preparing engine: Could not find the following tasks in project: lint

Just double checked and both my globally installed and locally installed versions are at 1.8.2.