"unexpected end of output" response.json() 错误
"unexpected end of output" error on response.json()
我在 response.json() 上不断收到 "unexpected end of output" 错误。我是否偏离了我在下面所做的事情?
Promise.all([requestOne, requestTwo])
.then(responses => {
responses.reduce((promise,response) => {
return promise.then(() => {
return response.json()
}).then(result => result)
}, Promise.resolve());
})
编辑、更新
问题是 {mode:"no-cors"}
设置在 fetch
。在 fetch
调用
时用 {method: "get"}
替换 {mode:"no-cors"}
我在 response.json() 上不断收到 "unexpected end of output" 错误。我是否偏离了我在下面所做的事情?
Promise.all([requestOne, requestTwo])
.then(responses => {
responses.reduce((promise,response) => {
return promise.then(() => {
return response.json()
}).then(result => result)
}, Promise.resolve());
})
编辑、更新
问题是 {mode:"no-cors"}
设置在 fetch
。在 fetch
调用
{method: "get"}
替换 {mode:"no-cors"}