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
优化waitForSuccessfulPing方法 #4501
Comments
具体什么场景下会有区别? |
我想部署在服务器上通过Nginx反向代理访问,Nginx始终会有响应的,这里就会执行到break然后刷新页面,但实际服务是不可用的。
|
I was having the same issue in my project where we are using a proxy to serve the Vite dev server. The suggested solution is working for me after applying it to line 338 in More detail on the issue: for some reason, the error thrown by the fetch request in the current code is not causing the catch statement to catch any errors (and properly try again after the If there isn't a PR already made for this, I'd be happy to submit it so that we don't have to fork Vite or apply our own patch going forward. |
Great! Can you submit a PR?
… 在 2021年10月28日,06:24,Michael Warner ***@***.***> 写道:
I was having the same issue in my project where we are using a proxy to serve the Vite dev server. The suggested solution is working for me after applying it to line 338 in node_modules/vite/dist/client/client.mjs. Thanks @wulify!
More detail on the issue: for some reason, the error thrown by the fetch request in the current code is not causing the catch statement to catch any errors (and properly try again after the ms timeout), but if you check for rst.ok manually (as suggested) you can then throw an error manually and the original logic works fine. Simple fix, but effective!
If there isn't a PR already made for this, I'd be happy to submit it so that we don't have to fork Vite or apply our own patch going forward.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Clear and concise description of the problem
仅当网络故障时或请求被阻止时放弃轮询,我觉得是不够的,可以判断一下fetch结果中的ok属性,true时才放弃轮询
Suggested solution
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: