-
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 rebuilds code constantly (Android) #2640
Comments
The reason why rebuilds are happening should already be printed to the terminal. What does the terminal output say? |
Ah yes I missed that. It says
That resolves to /data/data which I do not have permission to access. |
Thanks. I think I know what's happening then. Android is unusual in that it has an inaccessible directory in the path to the root, which esbuild was not originally built to handle. To handle cases like this, the file system layer in esbuild has a hack where it treats inaccessible directories as empty. However, esbuild's watch implementation currently triggers a rebuild if a directory previously encountered an error but the directory now exists. The assumption is that the previous error was caused by the directory not existing. Although that's usually the case, it's not the case here. Instead the error is that the directory previously existed but was inaccessible. This causes esbuild's watch implementation to rebuild continuously. I can reproduce the issue myself so I should be able to fix this. |
Hello. This is basically the same as #1113, but I'm only seeing it on Android/Termux. --watch mode works fine for me on Linux and Windows.
On Android (aarch64, kernel 5.4.147), if I run
esbuild --bundle index.js --watch
, it rebuilds the file nonstop. Happens for a single one-line file in an otherwise empty directory, and also for a large/complex app.Let me know if there's anything I can provide to assist in troubleshooting. I might dig around the code myself if I can find time.
The text was updated successfully, but these errors were encountered: