Tony Veigel Tony Veigel - 3 months ago 5x
Javascript Question

"unexpected end of output" error on response.json()

I keep getting an "unexpected end of output" error on response.json(). Am I way off base on what I am doing below?

Promise.all([requestOne, requestTwo])
.then(responses => {
responses.reduce((promise,response) => {
return promise.then(() => {
return response.json()
}).then(result => result)
}, Promise.resolve());


Edit, Updated

The issue is {mode:"no-cors"} setting at fetch. Substitute {method: "get"} for {mode:"no-cors"} at fetch call