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.

Problems with axios on Windows (IE 11)

See original GitHub issue

Hi

I’m trying to figure out why axios isn’t working on Windows (Internet Explorer 11).

When I try to make a post or get request it sends the data just fine but returns an syntax error in .catch():


My call:

axios.post(API_URL, {
    some: data
}).then(function(response) {
    console.log('Yaaaay:', response);
}).catch(function(response) {
    console.log('Noooo :(', response)
});

The response in catch():

{   [functions]: ,   __proto__: { },   
      ABORT_ERR: 20,   
      code: 12,  
      constructor: { },   
      DATA_CLONE_ERR: 25,   
      DOMSTRING_SIZE_ERR: 2,   
      HIERARCHY_REQUEST_ERR: 3,   
      INDEX_SIZE_ERR: 1,   
      INUSE_ATTRIBUTE_ERR: 10,   
      INVALID_ACCESS_ERR: 15,   
      INVALID_CHARACTER_ERR: 5,   
      INVALID_MODIFICATION_ERR: 13,   
      INVALID_NODE_TYPE_ERR: 24,   
      INVALID_STATE_ERR: 11,   
      message: "SyntaxError",   
      name: "SyntaxError",   
      NAMESPACE_ERR: 14,   
      NETWORK_ERR: 19,   
      NO_DATA_ALLOWED_ERR: 6,   
      NO_MODIFICATION_ALLOWED_ERR: 7,   
      NOT_FOUND_ERR: 8,   
      NOT_SUPPORTED_ERR: 9,   
      PARSE_ERR: 81,   
      QUOTA_EXCEEDED_ERR: 22,   
      SECURITY_ERR: 18,   
      SERIALIZE_ERR: 82,   
      SYNTAX_ERR: 12,   
      TIMEOUT_ERR: 23,   
      TYPE_MISMATCH_ERR: 17,   
      URL_MISMATCH_ERR: 21,   
      VALIDATION_ERR: 16,   
      WRONG_DOCUMENT_ERR: 4
   }

I’m not sure what to read of this.

The code works perfect in all other browsers on Windows/Mac.

I thought it might be a polyfill problem, so I included the es6-polyfill to my bundle but still no success.

Any suggestions?

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
anhvoduycommented, Mar 15, 2019

at Client Side, can set headers for request: - axios.defaults.headers.get[‘Pragma’] = ‘no-cache’; - axios.defaults.headers.get[‘Cache-Control’] = ‘no-cache, no-store’; at Server Side, set headers for response: - https://www.npmjs.com/package/nocache

4reactions
ralphtheninjacommented, Jun 22, 2019

at Client Side, can set headers for request:

  • axios.defaults.headers.get[‘Pragma’] = ‘no-cache’;
  • axios.defaults.headers.get[‘Cache-Control’] = ‘no-cache, no-store’;

Disabling cache on the client side was enough to fix my problems. @anhvoduy Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

axios IE promise doesn't work - Stack Overflow
I have problem with IE. IE return error about Promise. IE doesn't know anything about Promise. I am writing react/redux but I tried...
Read more >
Microsoft pulls plug on Internet Explorer today after 27 years
Microsoft announced last year that they would be retiring the browser today and shift their focus to Microsoft Edge.
Read more >
axios - npm
Promise based HTTP client for the browser and node.js. Latest version: 1.2.1, last published: 22 days ago. Start using axios in your project ......
Read more >
Manage npm packages - Visual Studio (Windows)
Visual Studio helps you to manage packages using the Node.js package manager (npm)
Read more >
Axios vs. fetch(): Which is best for making HTTP requests?
One of the main selling points of Axios is its wide browser support. Even old browsers like IE11 can run Axios without any...
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