-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Persistent tasks in watch mode don't wait for first run of their dependencies to finish #8673
Comments
Hi, thanks for the issue. We currently don't have the capacity to work on this currently. If you want, you're welcome to open a PR for it and I can provide guidance. |
@NicholasLYang IMHO this feels like a huge blocker of turborepo adoption. Given it isn't a priority I feel like I am missing something. As someone trying to use If i am understanding correctly, the usual set up is:
Whenever a package changes, the dependent apps need to know about it. Without it, one would have to restart I tried various work arounds:
The best solution for now has been using packages without a build step and just export the ts files directly as much as possible and let the host apps bundler bundle the package instead. Appreciate any guidance / insight! |
Hi @Patrick-Ullrich, sorry for the late reply! Could you try using the new |
@NicholasLYang That sounds like it would do the trick! Part of 2.2.3? Should it work like this:
Also happy to take this conversation somewhere else if we are getting too off topic! |
I'm trying to cover very similar case where packages are build while main app uses webpack dev server. |
@KajSzy I experienced something similar to this and it turned out it was a bug in the latest v2.2.3 release where persistent tasks were accidently stopped in watch mode: #9330. Fixed in v2.2.4-canary.2+ |
Yes, with 2.3 release it was fixed |
Is there a way to configure it so that only the non-persistent tasks are executed after the first run? I have a configuration like so:
and while this does wait for the first run of dependencies to finish, subsequent changes to packages also runs |
I'm facing the same situation in This is without the
(I expect Like the OP, |
I did an awful hack that involved the use of the
So what happens when I run the
|
There still seems to be something going on with watch. I'm following the kitchen sink api example and either turbo watch or tsup --watch isn't detecting changes. |
@dylanjmcdonald In the context of the kitchen sink example, if you change the code inside of This led me to then make the following changes:
This leaves us with the following setup:
However, with such setup (which i believe is an extremely common one in monorepos) there is a bug currently ( Repro steps:
I believe this bug is documented here => #9421 I haven't been able to find a good workaround for this issue. UPDATE: |
Verify canary release
Link to code that reproduces this issue
https://github.com/OliverJAsh/turbo-watch-deps-of-persistent
What package manager are you using / does the bug impact?
Yarn v2/v3/v4 (node_modules linker only)
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
2.0.6-canary.0
Describe the Bug
Persistent tasks in watch mode don't wait for first run of their dependencies to finish.
b
depends on packagea
.In non-watch / run mode, build
a
correctly runs before buildb
:However, in watch mode, Turbo runs both builds in parallel. Build
b
does not wait for builda
to finish even though it's a dependency:Expected Behavior
Persistent tasks in watch mode should wait for the first run of their dependencies to finish, otherwise they may fail.
To Reproduce
yarn
.TURBO_UI=false yarn run turbo watch build --filter b
.Additional context
I believe the idea is that persistent tasks should self-heal: #8164 (comment)
However, this is inefficient and can lead to confusing error messages.
In our case we're using webpack watch and rebuilding is CPU intensive, so it would be better if webpack waited for its dependencies to finish building before starting.
Furthermore, our webpack watch task can only self-heal after the build has started—it can't self-heal if the configuration itself is missing dependencies.
We only expect the order to be respected for the first run, not subsequent to that.
The text was updated successfully, but these errors were encountered: