Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"missing tasks" when using root task + filters #9619

Open
1 task done
benjick opened this issue Dec 15, 2024 · 3 comments
Open
1 task done

"missing tasks" when using root task + filters #9619

benjick opened this issue Dec 15, 2024 · 3 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@benjick
Copy link

benjick commented Dec 15, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/benjick/missing-tasks-filter-root-repro

Which canary version will you have in your reproduction?

2.3.4-canary.2

Enviroment information

turbo info
turbo 2.3.4-canary.2

CLI:
   Version: 2.3.4-canary.2
   Path to executable: /Users/max/dev/missing-tasks-filter-root-repro/node_modules/.pnpm/[email protected]/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Running
   Package manager: pnpm

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 14359
   Available CPU cores: 10

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): WarpTerminal
   Terminal program version (TERM_PROGRAM_VERSION): v0.2024.12.10.15.55.stable_03
   Shell (SHELL): /opt/homebrew/bin/fish
   stdin: false

Expected behavior

When running turbo run --filter=!pkg-b build root, where root is a root task ("//#root") I expected turbo to execute the task

Actual behavior

  × missing tasks in project

Error:   × could not find task `root` in project

To Reproduce

Clone https://github.com/benjick/missing-tasks-filter-root-repro
run pnpm error

Additional context

It works if I run turbo run --filter=!pkg-b build //#root

@benjick benjick added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Dec 15, 2024
@ahsath
Copy link

ahsath commented Dec 20, 2024

I sort of have the same error.

e.g. I have 3 apps, 2 of them with

  "scripts": {
    "dev": "vite"

and one with

  "scripts": {
    "dev": "npm run server:dev",
    "server:dev": "npm run server",

if I understand when defining root tasks, e.g. dev turborepo will search all packages.json files for scripts that matches the name for the same task name, but for some reason I get missing scripts

Screenshot

My turbo.json pretty straighforward

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

Only one script successfully runs (see image attachment), I am not quite sure if it is a Vite issue regarding ports (race condition), tried changing the port on each project (didn't work), although this missing scripts does not always occurs, I think it has to do with the ports these apps are running because if I restart my computer it runs fine for a couple of times but if I exit turbo and run it again, it errors out with missing scripts. It is like turborepo is trying to execute scripts from one project into another if all registered scripts do not match the same CLI tool you use, in my case is Vite.

@benjick
Copy link
Author

benjick commented Dec 20, 2024

What error do you get?

@ahsath
Copy link

ahsath commented Dec 21, 2024

reinstalled everything, updated dependencies and I no longer get this missing scripts errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

No branches or pull requests

2 participants