question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No statusText on Chrome

See original GitHub issue

Summary

The response should include status: 200 and statusText: "OK" but Chrome returns the empty string in statusText property. Firefox is OK.

Steps to reproduce:
  1. copy dist/axios.min.js to console
  2. paste following code to Chrome console
    (async () => {
      const res = await axios.get(location.href);
      console.log('status', res.status);
      console.log('statusText', `"${res.statusText}"`);
    })();
    

Context

  • axios version:
    • v0.18.0
    • v0.17.1
  • Environment:
    • Google Chrome (66.0.3359.117 64bit)
    • Google Chrome (66.0.3359.139 64bit)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:8

github_iconTop GitHub Comments

3reactions
JonasJonnycommented, Sep 6, 2019

is it a bug of chrome?

Not only.

Chrome 49+ empty, Opera 36+ empty, Safari 10.1.1 empty.

Drop response.statusText and use response.status as solution.

1reaction
narrowizardcommented, Jan 9, 2020

@MetaiR I dropped “OK” and started to use response.status === 200.

response.status >= 200 && response.status < 300 is more reliable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the statusText of my XHR empty? - Stack Overflow
For some reason on Chrome statusTexts started to return empty as soon as we installed an SSL certificate in our server and url...
Read more >
Response.statusText - Web APIs | MDN
The statusText read-only property of the Response interface contains the status message corresponding to the HTTP status code in ...
Read more >
{“readyState”:0”responseText”:””,”status”:0:0,”statusText”:”error ...
Hello, I am having an issue where the tag app is no longer working on my Android device. My phone is running Android...
Read more >
Response.statusText
The statusText read-only property of the Response interface contains the status ... Android webview, Chrome for Android, Edge Mobile, Firefox for Android ...
Read more >
Change your availability status and mute notifications in ...
Status icon, Status text, Status meaning. "" Active, Gmail or Google Chat is open. "" Do not disturb. Google Chat notifications are muted....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found