fetch not shown in network tab when .then(response => response.json()) fails
Reported by
jomeh...@gmail.com,
May 3 2018
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Steps to reproduce the problem:
1. Create an endpoint that doesn't return content data.
2. fetch(`/api/jobs/${jobId}`, {
headers: {
"content-type": "application/json"
},
method: "DELETE"
})
.then(response => response.json())
.then(data => console.log(data)))
What is the expected behavior?
The request is shown in the network tab to investigate the response.
What went wrong?
The request isn't shown, so it seems like the request never was done.
Did this work before? N/A
Chrome version: 66.0.3359.139 Channel: stable
OS Version: 10.0
Flash Version:
Adding a catch at the end of the promise makes it work like expected:
fetch(`/api/jobs/${jobId}`, {
headers: {
"content-type": "application/json"
},
method: "DELETE"
})
.then(response => response.json())
.then(data => console.log)))
.catch(error => console.log)
,
May 7 2018
Tested the issue on chrome reported version 66.0.3359.139 using Windows 10 with steps mentioned below:
1) Launched chrome reported version and opened Devtools > Console
2) In console given: fetch(`/api/jobs/${jobId}`, {
headers: {
"content-type": "application/json"
},
method: "DELETE"
})
.then(response => response.json())
.then(data => console.log(data))), it returns error message: "Uncaught SyntaxError: Unexpected token )"
Note: Also navigated to Devtools > Network tab, seen 43 requests generated
@Reporter: Please find the attached screencast for your reference and let us know if we missed anything in reproducing the issue, if possible could you please provide the screencast of the issue which helps in better understanding, any further inputs on it are most helpful.
Thanks!
,
May 10 2018
Cannot reproduce. I can see a failed fetch in Network panel no matter if there's a catch or not. Closing it for now. Please reopen if you can provide a screencast or more details. Thank you. |
|||
►
Sign in to add a comment |
|||
Comment 1 by susan.boorgula@chromium.org
, May 4 2018