-
Notifications
You must be signed in to change notification settings - Fork 253
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
trunk serve can get caught in a build loop when compiling web workers #422
Comments
I've noticed this happens when I sometimes git pull or bring in new files. Still trying to find the root cause. My theory is that (without looking at the code) It probably rebuilds once per new file introduced, so if a lot of new code gets introduced at once, it may be re-compiling for a while, and seem like an infinite loop. |
This happens to me all the time, trunk spends 100% of the time rebuilding useless stuff |
I'm also affected it's also maybe a duplicate of #382 |
Most of the time it does eventually settle down and stop rebuilding…
mostly… to be honest I am so thankful to trunk for making web workers work
so nicely that I almost don’t want to bring it up!
…On Sat, 27 Aug 2022 at 19:17, DimitriTimoz ***@***.***> wrote:
I'm also affected it's also maybe a duplicate of #382
<#382>
—
Reply to this email directly, view it on GitHub
<#422 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCDOXV35R3BIT2NAJGLV3JLS7ANCNFSM57ZKKSHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Having witnessed this quite a few times by now, this seems to be accurate. Another example is that when using cargo clippy as an external linter in WebStorm, it'll compile 2 to 3 times more than normal when saving, because the file actually changes multiple times. It looks like each change queues a rebuild, where for most cases it's probably fine to just do the |
@gilescope that's it ... we're removing support for web workers in Trunk! Too much maintenance overhead! JK JK, hopefully we can get this issue pinned down soon. |
@gilescope @webbertakken @Mubelotix if folks don't mind running trunk with verbose logging, it will tell you where the changes were detected. EG: So, if you are certain that this is not a config issue, then this is probably the next best thing to look into. Find out which files are changing which are causing trunk to re-build, then we can determine the root cause. You should see a log line similar to:
|
This happens to me often when switching branches. When running trunk with the -v flag I see it's doing a rebuild for each changed file. This is with trunk 0.16.0. |
Ok, looks like this is a known issue which folks are seeing: notify-rs/notify#259 As it turns out, this is not due to a library we are using, but comes from I've implemented a solution to address this. A cooldown period following a build. All events will be ignored following a build completion for the cooldown period, which I will hardcode to 1s for now. That should be enough without impacting the development flow. |
If I make a change and trunk serve detects it and rebuilds my code and the web worker, it occasionally will go into a loop. I guess the building of one can sometimes trigger the rebuilding of the other and so on and so on... a restart fixes it and then it's well behaved for a while. Does the webworker generat a js file that re-triggers the build or something?
The text was updated successfully, but these errors were encountered: