提问人:Mehdi 提问时间:11/16/2023 最后编辑:Mehdi 更新时间:11/16/2023 访问量:29
TypeError:不时发生无法提取 [已关闭]
TypeError: Failed to fetch occurs from time to time [closed]
问:
下面的代码在我们的测试中和 99.9% 的用户中都能正常工作,但有时对于我们的某些用户的请求会出现“TypeError: Failed to fetch”!!
法典:
var response = await fetch('/Chart/GetBars', true);
未发生错误时的请求和响应标头:
我们从客户那里收到的所有详细信息:
{
"Log": {
"Method": "GET",
"Url": "https://example.com/Entity/Summary/50/1102/GetBars",
"Fields": [
{
"Key": "url",
"Value": "https://example.com/Entity/Summary/50/1102/GetBars"
},
{
"Key": "data",
"Value": "1"
}
],
"Client error details": {
"name": "TypeError",
"message": "Failed to fetch",
"stack": "TypeError: Failed to fetch"
},
"url": "https://example.com/Entity/Summary/50/1102/GetBars",
"Headers": [
{
"Key": "Accept",
"Value": "*/*"
},
{
"Key": "Accept-Encoding",
"Value": "gzip, deflate, br"
},
{
"Key": "Accept-Language",
"Value": "q=0.9,en-US;q=0.8,en;q=0.7,ar;q=0.6"
},
{
"Key": "Connection",
"Value": "close"
},
{
"Key": "Content-Length",
"Value": "2291"
},
{
"Key": "Content-Type",
"Value": "multipart/form-data; boundary=----WebKitFormBoundaryDlWKCQ0zlFzwixM1"
},
{
"Key": "Host",
"Value": "example.com"
},
{
"Key": "Referer",
"Value": "https://example.com/Entity/Summary/50/1102"
},
{
"Key": "User-Agent",
"Value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
},
{
"Key": "sec-ch-ua",
"Value": ""Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24""
},
{
"Key": "sec-ch-ua-mobile",
"Value": "?0"
},
{
"Key": "sec-ch-ua-platform",
"Value": ""Windows""
},
{
"Key": "origin",
"Value": "https://example.com"
},
{
"Key": "sec-fetch-site",
"Value": "same-origin"
},
{
"Key": "sec-fetch-mode",
"Value": "cors"
},
{
"Key": "sec-fetch-dest",
"Value": "empty"
}
]
}
}
我们如何解决此错误?
有没有另一种方法可以将更多信息从客户端发送到服务器?
答: 暂无答案
下一个:Gif未在react中加载
评论