-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
watch
bug with logLevel: "debug"
on Linux
#2661
Comments
I think I can reproduce this on Mac if I run this in the terminal in my home directory: while true; do touch foo; sleep 0.1; rm foo; sleep 0.1; done So maybe your Linux system has some process that is repeatedly creating and destroying a file like this? I'll investigate this on the esbuild end of things. |
Thanks! The other relevant part of the reported issue is that the |
It looks like this is caused by this code here: esbuild/internal/resolver/resolver.go Lines 918 to 923 in ba47710
When debugging is enabled, the path resolution subsystem is generating a log message that says something like "Read 20 entries for directory /home/user". This causes the file subsystem to add a dependency on the full list of entries in that directory since if that changes, the generated log message would also have to be updated. Arguably the content of log messages could be considered not important as far as watch mode is concerned, so perhaps this code could "peek" at the file subsystem's state without it recording that the state was observed. |
I believe I have found a bug that appears to be specific to linux. I'm unable to reproduce it on my Mac, but it happens every time on my Linux machine. I've made a minimum viable example to reproduce this:
app.ts
:esbuild.js
:The issue is that the watch directory ends up traversing outside of the project directory and building infinitely:
However, this doesn't happen if change
logLevel
toinfo
.esbuild version:
0.15.13
distro:
Linux Mint 21 (Ubuntu 22.04 LTS)
node version: Probably doesn't matter but I reproduced on multiple node versions (16 and 19)
The text was updated successfully, but these errors were encountered: