Skip to content

Conversation

Yuvraj-cyborg
Copy link

Problem:

  • dependsOn failed when referencing pkg#task where task exists in the package’s package.json but not in its turbo.json. Error: Could not find "pkg#task" in root turbo.json or "task" in package.

Fix:

  • When resolving a non-root pkg#task that has a matching script in that package’s package.json, synthesize a default task definition so the dependency is valid without a workspace turbo.json entry. Root tasks remain required in root turbo.json.
  • Repro: https://github.com/kalkulacka-one/kalkulacka/tree/turbo-bug (2.5.4-canary.0)
  • With this change, schema-web#build:openapi is recognized and executed. Verified via dry run and actual command resolution.

Tests:

  • Manual verification with the linked repo. Existing tests around task resolution still pass locally.

… packages without workspace turbo.json entries; fixes cross-workspace task lookup error for pkg#task in dependsOn
Copy link
Contributor

vercel bot commented Aug 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Preview Comment Aug 12, 2025 8:34pm
examples-designsystem-docs Ready Preview Comment Aug 12, 2025 8:34pm
examples-tailwind-web Ready Preview Comment Aug 12, 2025 8:34pm
examples-vite-web Ready Preview Comment Aug 12, 2025 8:34pm

Copy link
Contributor

vercel bot commented Aug 12, 2025

@Yuvraj-cyborg is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@Yuvraj-cyborg Yuvraj-cyborg changed the title engine: allow dependsOn to reference package.json scripts in non-root packages fix: allow dependsOn to reference package.json scripts in non-root packages Aug 12, 2025
Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an intentional behavior of Turborepo to prevent unintentional misuse from incorrect task definitions.

@Yuvraj-cyborg
Copy link
Author

This is an intentional behavior of Turborepo to prevent unintentional misuse from incorrect task definitions.

should i find an other way around? for this issue then ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants