-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Verify canary release
- I verified that the issue exists in the latest Turborepo canary release.
Link to code that reproduces this issue
Which canary version will you have in your reproduction?
turbo@2.5.6
Environment information
CLI:
Version: 2.5.6
Path to executable: /Users/sohelislamimran/Development/kuno-backend/node_modules/turbo-darwin-arm64/bin/turbo
Daemon status: Running
Package manager: bun
Platform:
Architecture: aarch64
Operating system: macos
WSL: false
Available memory (MB): 4843
Available CPU cores: 12
Environment:
CI: None
Terminal (TERM): xterm-ghostty
Terminal program (TERM_PROGRAM): ghostty
Terminal program version (TERM_PROGRAM_VERSION): 1.2.0
Shell (SHELL): /bin/zsh
stdin: false
Expected behavior
As you can see, the existing discussion here #4143, turbo runs its tasks multiple times if that package is a dependency for several other packages within the monorepo. I don't know how many times it re-runs like that if it's a dependency in multiple packages (seems multiple times, if it's a dependency in 10 packages, then 10 times + 1 for its own), but this is totally unnecessary duplicate work, which we at least should have an option to avoid.
Actual behavior
This is creating a serious issue that we have been facing for a long time. If we have A depends on B and we have different tsconfig for A and B, and B gets type-checked first: Once during B's tsc with its tsconfig and again during A's tsc but with A's tsconfig. Which is causing errors if we have a different set of rules in B than in A.
Here you can see I'm having a typecheck error, because my email-templates package has JSX, and it's tsconfig we have JSX configured. But in notifications package's tsconfig we don't have JSX configured, because we aren't using JSX in that package. But because email-templates is a dependency in notifications, so tsc runs in email-templates while running on notifications but using notifications's tsconfig, which is causing this error.
To Reproduce
- Create some packages and add some of them that depend on other packages
- Add different tsconfigs which will work on their own package but not in others
- add
tsc --noEmitscript and task for typecheck - Run the typecheck task
Additional context
No response