Safari - WebInspector Network Tab - An error occurred trying to load the resource












15















I am seeing the error in the image below in Safari's Developer Tools (Network Tab) for the XHR/Fetch. The response body is not visible. It always throws the red text 'An error occurred trying to load the resource'. My initial thought was that the devtool wouldn't support fetch as opposed to XHR. But Safari 12 supports it.



example



OS: MacOS High Sierra
Browser: Safari 12 & Technology Preview 66



Does this have something to do with the response headers? XSS or something else?
PS: the same response body is visible in chrome dev tool.










share|improve this question

























  • Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

    – kemicofa
    Nov 23 '18 at 19:18











  • What does it show when you click on "Headers" (next to "Preview")?

    – Old Pro
    Nov 23 '18 at 21:56











  • @kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

    – Ramesh
    Nov 24 '18 at 8:25











  • @OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

    – Ramesh
    Nov 24 '18 at 12:13











  • @Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

    – kemicofa
    Nov 24 '18 at 18:02
















15















I am seeing the error in the image below in Safari's Developer Tools (Network Tab) for the XHR/Fetch. The response body is not visible. It always throws the red text 'An error occurred trying to load the resource'. My initial thought was that the devtool wouldn't support fetch as opposed to XHR. But Safari 12 supports it.



example



OS: MacOS High Sierra
Browser: Safari 12 & Technology Preview 66



Does this have something to do with the response headers? XSS or something else?
PS: the same response body is visible in chrome dev tool.










share|improve this question

























  • Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

    – kemicofa
    Nov 23 '18 at 19:18











  • What does it show when you click on "Headers" (next to "Preview")?

    – Old Pro
    Nov 23 '18 at 21:56











  • @kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

    – Ramesh
    Nov 24 '18 at 8:25











  • @OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

    – Ramesh
    Nov 24 '18 at 12:13











  • @Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

    – kemicofa
    Nov 24 '18 at 18:02














15












15








15


4






I am seeing the error in the image below in Safari's Developer Tools (Network Tab) for the XHR/Fetch. The response body is not visible. It always throws the red text 'An error occurred trying to load the resource'. My initial thought was that the devtool wouldn't support fetch as opposed to XHR. But Safari 12 supports it.



example



OS: MacOS High Sierra
Browser: Safari 12 & Technology Preview 66



Does this have something to do with the response headers? XSS or something else?
PS: the same response body is visible in chrome dev tool.










share|improve this question
















I am seeing the error in the image below in Safari's Developer Tools (Network Tab) for the XHR/Fetch. The response body is not visible. It always throws the red text 'An error occurred trying to load the resource'. My initial thought was that the devtool wouldn't support fetch as opposed to XHR. But Safari 12 supports it.



example



OS: MacOS High Sierra
Browser: Safari 12 & Technology Preview 66



Does this have something to do with the response headers? XSS or something else?
PS: the same response body is visible in chrome dev tool.







javascript safari devtools safari-web-inspector






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 16:00









W.Ambrozic

901212




901212










asked Sep 27 '18 at 6:56









RameshRamesh

3452412




3452412













  • Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

    – kemicofa
    Nov 23 '18 at 19:18











  • What does it show when you click on "Headers" (next to "Preview")?

    – Old Pro
    Nov 23 '18 at 21:56











  • @kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

    – Ramesh
    Nov 24 '18 at 8:25











  • @OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

    – Ramesh
    Nov 24 '18 at 12:13











  • @Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

    – kemicofa
    Nov 24 '18 at 18:02



















  • Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

    – kemicofa
    Nov 23 '18 at 19:18











  • What does it show when you click on "Headers" (next to "Preview")?

    – Old Pro
    Nov 23 '18 at 21:56











  • @kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

    – Ramesh
    Nov 24 '18 at 8:25











  • @OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

    – Ramesh
    Nov 24 '18 at 12:13











  • @Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

    – kemicofa
    Nov 24 '18 at 18:02

















Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

– kemicofa
Nov 23 '18 at 19:18





Hello, could you please provide more information what kind of server you're running as well as some general code to help "us" provide with you with a more speicific answer. As you must have noticed this is probably not directly related to Safari. Have you tried this with other navigators?

– kemicofa
Nov 23 '18 at 19:18













What does it show when you click on "Headers" (next to "Preview")?

– Old Pro
Nov 23 '18 at 21:56





What does it show when you click on "Headers" (next to "Preview")?

– Old Pro
Nov 23 '18 at 21:56













@kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

– Ramesh
Nov 24 '18 at 8:25





@kemicofa the backend system java within adobe infrastructure. yes, the same http call via chrome displays the response body inn dev tool.

– Ramesh
Nov 24 '18 at 8:25













@OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

– Ramesh
Nov 24 '18 at 12:13





@OldPro :status: 200 Content-Type: application/json; charset=UTF-8 Pragma: no-cache Set-Cookie: *** Content-Encoding: gzip X-XSS-Protection: 1; mode=block Expires: Sat, 24 Nov 2018 09:32:23 GMT Cache-Control: max-age=0, no-cache, no-store Date: Sat, 24 Nov 2018 09:32:23 GMT Content-Length: 295 X-Content-Type-Options: nosniff X-Frame-Options: sameorigin Vary: Accept-Encoding retry-after: 5400 Server: Apache

– Ramesh
Nov 24 '18 at 12:13













@Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

– kemicofa
Nov 24 '18 at 18:02





@Ramesh is there a specific reason why the Content-Type is application/json ? It looks like you're getting an HTML page as a response no?

– kemicofa
Nov 24 '18 at 18:02












3 Answers
3






active

oldest

votes


















2





+100









On the right of the menu bar with preview there is response with an arrow next to it click on that and switch it to JSON that should do the trick.






share|improve this answer



















  • 2





    My JSON tab show exact error.

    – huocp
    Nov 29 '18 at 5:15



















1














The browser's error message describes the requirements for this request to complete successfully.



The server must grant access to the requested resource to your remote domain by sending a Access-Control-Allow-Origin response header.



In Safari 12, select the row in the network tab. The response will be displayed in the main area. Above it will be a few tabs. Select the Headers tab and take a look in the request part of the displayed data for some request info. For details on the request data, take a look under "Request Data". If applicable, there will be a small arrow there that you can press to see the full content of the request.






share|improve this answer
























  • My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

    – huocp
    Nov 29 '18 at 5:15



















0














The world is not ready for fetch().



To solve this, I easily converted from fetch() to axios.





  • body became data


  • json decoded automatically


  • credentials became withCredentials


I also added this function to determine if the response was ok:



function ok(resp) {
return resp && resp.status && resp.status >= 200 && resp.status < 400
}


That was all I needed to adjust in my case.






share|improve this answer


























  • thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

    – Ramesh
    Dec 18 '18 at 15:20











  • Yes the actual network request works, but debugging becomes a pain.

    – jchook
    Dec 24 '18 at 3:03











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52531175%2fsafari-webinspector-network-tab-an-error-occurred-trying-to-load-the-resourc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+100









On the right of the menu bar with preview there is response with an arrow next to it click on that and switch it to JSON that should do the trick.






share|improve this answer



















  • 2





    My JSON tab show exact error.

    – huocp
    Nov 29 '18 at 5:15
















2





+100









On the right of the menu bar with preview there is response with an arrow next to it click on that and switch it to JSON that should do the trick.






share|improve this answer



















  • 2





    My JSON tab show exact error.

    – huocp
    Nov 29 '18 at 5:15














2





+100







2





+100



2




+100





On the right of the menu bar with preview there is response with an arrow next to it click on that and switch it to JSON that should do the trick.






share|improve this answer













On the right of the menu bar with preview there is response with an arrow next to it click on that and switch it to JSON that should do the trick.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 28 '18 at 19:24









Yehuda SchwartzYehuda Schwartz

1,21111125




1,21111125








  • 2





    My JSON tab show exact error.

    – huocp
    Nov 29 '18 at 5:15














  • 2





    My JSON tab show exact error.

    – huocp
    Nov 29 '18 at 5:15








2




2





My JSON tab show exact error.

– huocp
Nov 29 '18 at 5:15





My JSON tab show exact error.

– huocp
Nov 29 '18 at 5:15













1














The browser's error message describes the requirements for this request to complete successfully.



The server must grant access to the requested resource to your remote domain by sending a Access-Control-Allow-Origin response header.



In Safari 12, select the row in the network tab. The response will be displayed in the main area. Above it will be a few tabs. Select the Headers tab and take a look in the request part of the displayed data for some request info. For details on the request data, take a look under "Request Data". If applicable, there will be a small arrow there that you can press to see the full content of the request.






share|improve this answer
























  • My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

    – huocp
    Nov 29 '18 at 5:15
















1














The browser's error message describes the requirements for this request to complete successfully.



The server must grant access to the requested resource to your remote domain by sending a Access-Control-Allow-Origin response header.



In Safari 12, select the row in the network tab. The response will be displayed in the main area. Above it will be a few tabs. Select the Headers tab and take a look in the request part of the displayed data for some request info. For details on the request data, take a look under "Request Data". If applicable, there will be a small arrow there that you can press to see the full content of the request.






share|improve this answer
























  • My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

    – huocp
    Nov 29 '18 at 5:15














1












1








1







The browser's error message describes the requirements for this request to complete successfully.



The server must grant access to the requested resource to your remote domain by sending a Access-Control-Allow-Origin response header.



In Safari 12, select the row in the network tab. The response will be displayed in the main area. Above it will be a few tabs. Select the Headers tab and take a look in the request part of the displayed data for some request info. For details on the request data, take a look under "Request Data". If applicable, there will be a small arrow there that you can press to see the full content of the request.






share|improve this answer













The browser's error message describes the requirements for this request to complete successfully.



The server must grant access to the requested resource to your remote domain by sending a Access-Control-Allow-Origin response header.



In Safari 12, select the row in the network tab. The response will be displayed in the main area. Above it will be a few tabs. Select the Headers tab and take a look in the request part of the displayed data for some request info. For details on the request data, take a look under "Request Data". If applicable, there will be a small arrow there that you can press to see the full content of the request.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 26 '18 at 19:50









UnPUnP

7111




7111













  • My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

    – huocp
    Nov 29 '18 at 5:15



















  • My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

    – huocp
    Nov 29 '18 at 5:15

















My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

– huocp
Nov 29 '18 at 5:15





My response did have Access-Control-Allow-Origin: *. It is only not able to show up in dev tool, but the web page works perfectly.

– huocp
Nov 29 '18 at 5:15











0














The world is not ready for fetch().



To solve this, I easily converted from fetch() to axios.





  • body became data


  • json decoded automatically


  • credentials became withCredentials


I also added this function to determine if the response was ok:



function ok(resp) {
return resp && resp.status && resp.status >= 200 && resp.status < 400
}


That was all I needed to adjust in my case.






share|improve this answer


























  • thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

    – Ramesh
    Dec 18 '18 at 15:20











  • Yes the actual network request works, but debugging becomes a pain.

    – jchook
    Dec 24 '18 at 3:03
















0














The world is not ready for fetch().



To solve this, I easily converted from fetch() to axios.





  • body became data


  • json decoded automatically


  • credentials became withCredentials


I also added this function to determine if the response was ok:



function ok(resp) {
return resp && resp.status && resp.status >= 200 && resp.status < 400
}


That was all I needed to adjust in my case.






share|improve this answer


























  • thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

    – Ramesh
    Dec 18 '18 at 15:20











  • Yes the actual network request works, but debugging becomes a pain.

    – jchook
    Dec 24 '18 at 3:03














0












0








0







The world is not ready for fetch().



To solve this, I easily converted from fetch() to axios.





  • body became data


  • json decoded automatically


  • credentials became withCredentials


I also added this function to determine if the response was ok:



function ok(resp) {
return resp && resp.status && resp.status >= 200 && resp.status < 400
}


That was all I needed to adjust in my case.






share|improve this answer















The world is not ready for fetch().



To solve this, I easily converted from fetch() to axios.





  • body became data


  • json decoded automatically


  • credentials became withCredentials


I also added this function to determine if the response was ok:



function ok(resp) {
return resp && resp.status && resp.status >= 200 && resp.status < 400
}


That was all I needed to adjust in my case.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 18 '18 at 5:02

























answered Dec 18 '18 at 4:50









jchookjchook

2,47812126




2,47812126













  • thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

    – Ramesh
    Dec 18 '18 at 15:20











  • Yes the actual network request works, but debugging becomes a pain.

    – jchook
    Dec 24 '18 at 3:03



















  • thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

    – Ramesh
    Dec 18 '18 at 15:20











  • Yes the actual network request works, but debugging becomes a pain.

    – jchook
    Dec 24 '18 at 3:03

















thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

– Ramesh
Dec 18 '18 at 15:20





thanks, i have validated same on safari. fetch actually works in 12+. I tried in Safari Technology Preview as well. please check below pen in safari. you will see the network response. codepen.io/zellwk/full/QvLRbE. I am suspecting the .html response, though type is json.

– Ramesh
Dec 18 '18 at 15:20













Yes the actual network request works, but debugging becomes a pain.

– jchook
Dec 24 '18 at 3:03





Yes the actual network request works, but debugging becomes a pain.

– jchook
Dec 24 '18 at 3:03


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52531175%2fsafari-webinspector-network-tab-an-error-occurred-trying-to-load-the-resourc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

ts Property 'filter' does not exist on type '{}'

mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window