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

Vite server ends up in a infinite reload loop when used with usb remote debugging on Android with chrome://inspect #6501

Closed
7 tasks done
darktears opened this issue Jan 13, 2022 · 6 comments
Labels

Comments

@darktears
Copy link

darktears commented Jan 13, 2022

Describe the bug

I have a vite project working perfectly fine on my desktop. Now I try to debug it on my phone using the remote debugger of chrome. I head to chrome://inspect, forward the port 3000 and then on the phone I can successfully load the website (so the port forwarding work just fine) but then vite server enters into a reloading loop and I have no idea why as a user. It seems some connection is lost (likely that hmr stuff) but there is no actionable feedback or useful debug since the debug output gets cleared because the page is reloaded. I think a 4s timeout would already help any developer to gather some log before everything is cleared up. Finally I'm kind of sure that I need to forward more ports than 3000 but it's not explained anywhere in the doc if that's the case.

Anybody ever tried to debug a vite app on a phone through USB?

Reproduction

https://github.com/foldable-devices/demos/tree/master/starfold

System Info

Windows, Android device, Chrome.

Used Package Manager

npm

Logs

No response

Validations

@ygj6
Copy link
Member

ygj6 commented Jan 15, 2022

See if this #4259 can help you.

@ygj6 ygj6 added the feat: hmr label Jan 15, 2022
@darktears
Copy link
Author

Nothing worked me. Disabling hmr also doesn't work and the page keeps reloading.

@darktears
Copy link
Author

At this point I don't mind reloading manually, is there any workaround to have the server just serve the page and that's it?

@sapphi-red
Copy link
Member

@darktears I was not able to reproduce (windows chrome + android).
Does it still happen?

It reproduced when I set server.hmr.port to a port which is not forwarded. So it might happened by that for some reason.

@sapphi-red sapphi-red added the cannot reproduce The bug cannot be reproduced label May 29, 2022
@timothyallan
Copy link

FWIW I still have the exact same issue on my iOS devices using Charles Proxy. Nothing in the other infinite reboot threads have helped, including disabling hmr. Works great on all my desktop browsers.

@sapphi-red
Copy link
Member

This might be because a port was forwarded to a different port. #8650 covers this case.
Closing this issue for now. Please try 3.0.0-beta.1.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants