Skip to content
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

Update esbuild to latest version (wrangler dev does not work on Android) #1732

Closed
Resonious opened this issue Aug 25, 2022 · 7 comments · Fixed by #2661
Closed

Update esbuild to latest version (wrangler dev does not work on Android) #1732

Resonious opened this issue Aug 25, 2022 · 7 comments · Fixed by #2661
Labels
bug Something that isn't working quick win Potentially easy/straightforward issue to tackle

Comments

@Resonious
Copy link

Resonious commented Aug 25, 2022

What version of Wrangler are you using?

2.0.27

What operating system are you using?

Android

Describe the Bug

UPDATE: this is actually an esbuild bug: evanw/esbuild#2640. Therefore, we can probably fix this either by not using esbuild's watch feature or by fixing the bug in esbuild itself.

I realize I may be a freak for developing on Android, but alas I do and I'm unable to perform the quick Workers example on the readme.

The npx wrangler dev index.js command does run "successfully", but it spam reloads and the server is inaccessible.
SmartSelect_20220825-211751_Termux

Pretty much the same result whether or not I pass --local. A basic Express server runs fine on this device so I don't think there's anything wrong with my environment.

@Resonious Resonious added the bug Something that isn't working label Aug 25, 2022
@rozenmd
Copy link
Contributor

rozenmd commented Sep 12, 2022

Hey @Resonious, don't suppose you have any tips/guides for setting up an android to replicate this bug?

@penalosa penalosa added the needs reproduction Needs reproduction from OP label Oct 6, 2022
@Resonious
Copy link
Author

@rozenmd Sorry for the slow follow-up! One popular Android terminal emulator is Termux.

On Termux, you can pkg install nodejs and npx wrangler generate test. Running npx wrangler dev on the fresh project will reproduce this issue.

@Resonious
Copy link
Author

Invoking Miniflare directly appears to work fine, so I'm guessing there's something about the way Wrangler forks Miniflare that Android doesn't like.

@Resonious
Copy link
Author

Quick update! I have some free time today so I'm looking into this. So far I've traced this back to the esbuild watcher. The watcher seems to be constantly reporting changes. If I remove the bundle from the React effect that restarts the server, it "works" as long as I toggle local mode or do something else to kick off the initial build/run.

I'm going to see if I can figure out whether this is actually an esbuild bug on Android or if there's some config we can pass to calm it down.

@Resonious
Copy link
Author

Resonious commented Oct 28, 2022

This seems related but it's supposedly fixed already: evanw/esbuild#1113

@Resonious
Copy link
Author

Yeah okay sorry for the spam. I was able to reproduce this with just esbuild: esbuild --bundle --watch index.js.

I opened an issue on esbuild itself: evanw/esbuild#2640 - once that's fixed, all we need to do is update the esbuild dependency in Wrangler.

@jiesou
Copy link

jiesou commented Nov 24, 2022

This problem seems to still exist in the latest release (2.4.4)

@penalosa penalosa added quick win Potentially easy/straightforward issue to tackle and removed needs reproduction Needs reproduction from OP labels Nov 24, 2022
@penalosa penalosa changed the title 🐛 BUG: wrangler dev does not work on Termux/Android Update esbuild to latest version (wrangler dev does not work on Android) Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working quick win Potentially easy/straightforward issue to tackle
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants