{"action":"created","issue":{"url":"https://api.github.com/repos/mzabriskie/axios/issues/297","repository_url":"https://api.github.com/repos/mzabriskie/axios","labels_url":"https://api.github.com/repos/mzabriskie/axios/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/mzabriskie/axios/issues/297/comments","events_url":"https://api.github.com/repos/mzabriskie/axios/issues/297/events","html_url":"https://github.com/mzabriskie/axios/issues/297","id":148694852,"number":297,"title":"Problems with axios on Windows (IE 11)","user":{"login":"rasmuswoelk","id":640976,"avatar_url":"https://avatars.githubusercontent.com/u/640976?v=3","gravatar_id":"","url":"https://api.github.com/users/rasmuswoelk","html_url":"https://github.com/rasmuswoelk","followers_url":"https://api.github.com/users/rasmuswoelk/followers","following_url":"https://api.github.com/users/rasmuswoelk/following{/other_user}","gists_url":"https://api.github.com/users/rasmuswoelk/gists{/gist_id}","starred_url":"https://api.github.com/users/rasmuswoelk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasmuswoelk/subscriptions","organizations_url":"https://api.github.com/users/rasmuswoelk/orgs","repos_url":"https://api.github.com/users/rasmuswoelk/repos","events_url":"https://api.github.com/users/rasmuswoelk/events{/privacy}","received_events_url":"https://api.github.com/users/rasmuswoelk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-15T15:41:35Z","updated_at":"2016-04-19T11:53:36Z","closed_at":"2016-04-19T11:53:36Z","body":"Hi\r\n\r\nI'm trying to figure out why axios isn't working on Windows (Internet Explorer 11).\r\n\r\nWhen I try to make a post or get request it sends the data just fine but returns an syntax error in .catch():\r\n\r\n```\r\n\r\nMy call:\r\n\r\naxios.post(API_URL, {\r\n    some: data\r\n}).then(function(response) {\r\n    console.log('Yaaaay:', response);\r\n}).catch(function(response) {\r\n    console.log('Noooo :(', response)\r\n});\r\n\r\nThe response in catch():\r\n\r\n{   [functions]: ,   __proto__: { },   \r\n      ABORT_ERR: 20,   \r\n      code: 12,  \r\n      constructor: { },   \r\n      DATA_CLONE_ERR: 25,   \r\n      DOMSTRING_SIZE_ERR: 2,   \r\n      HIERARCHY_REQUEST_ERR: 3,   \r\n      INDEX_SIZE_ERR: 1,   \r\n      INUSE_ATTRIBUTE_ERR: 10,   \r\n      INVALID_ACCESS_ERR: 15,   \r\n      INVALID_CHARACTER_ERR: 5,   \r\n      INVALID_MODIFICATION_ERR: 13,   \r\n      INVALID_NODE_TYPE_ERR: 24,   \r\n      INVALID_STATE_ERR: 11,   \r\n      message: \"SyntaxError\",   \r\n      name: \"SyntaxError\",   \r\n      NAMESPACE_ERR: 14,   \r\n      NETWORK_ERR: 19,   \r\n      NO_DATA_ALLOWED_ERR: 6,   \r\n      NO_MODIFICATION_ALLOWED_ERR: 7,   \r\n      NOT_FOUND_ERR: 8,   \r\n      NOT_SUPPORTED_ERR: 9,   \r\n      PARSE_ERR: 81,   \r\n      QUOTA_EXCEEDED_ERR: 22,   \r\n      SECURITY_ERR: 18,   \r\n      SERIALIZE_ERR: 82,   \r\n      SYNTAX_ERR: 12,   \r\n      TIMEOUT_ERR: 23,   \r\n      TYPE_MISMATCH_ERR: 17,   \r\n      URL_MISMATCH_ERR: 21,   \r\n      VALIDATION_ERR: 16,   \r\n      WRONG_DOCUMENT_ERR: 4\r\n   }\r\n\r\n```\r\nI'm not sure what to read of this.\r\n\r\nThe code **works perfect** in all other browsers on Windows/Mac.\r\n\r\nI thought it might be a polyfill problem, so I included the [es6-polyfill](https://github.com/stefanpenner/es6-promise) to my bundle but still no success.\r\n\r\nAny suggestions?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/mzabriskie/axios/issues/comments/211878952","html_url":"https://github.com/mzabriskie/axios/issues/297#issuecomment-211878952","issue_url":"https://api.github.com/repos/mzabriskie/axios/issues/297","id":211878952,"user":{"login":"rasmuswoelk","id":640976,"avatar_url":"https://avatars.githubusercontent.com/u/640976?v=3","gravatar_id":"","url":"https://api.github.com/users/rasmuswoelk","html_url":"https://github.com/rasmuswoelk","followers_url":"https://api.github.com/users/rasmuswoelk/followers","following_url":"https://api.github.com/users/rasmuswoelk/following{/other_user}","gists_url":"https://api.github.com/users/rasmuswoelk/gists{/gist_id}","starred_url":"https://api.github.com/users/rasmuswoelk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasmuswoelk/subscriptions","organizations_url":"https://api.github.com/users/rasmuswoelk/orgs","repos_url":"https://api.github.com/users/rasmuswoelk/repos","events_url":"https://api.github.com/users/rasmuswoelk/events{/privacy}","received_events_url":"https://api.github.com/users/rasmuswoelk/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T11:53:36Z","updated_at":"2016-04-19T11:53:36Z","body":"@nickuraltsev I have now tried to reproduce the problem by creating an isolated piece of code and then it worked just fine. \r\n\r\nKinda frustrated a looked through my own code and since IE didn't provide me with a very useful error code, I had to uncomment stuff until I narrowed down the root of the problem.\r\n\r\n**What I found out was this:**\r\n\r\nI have created a small module that I use in my project called request.js. All it really does is take an instance of axios, add some defaults and then export it.\r\n\r\nIt _looked_ like this:\r\n\r\n`import axios from 'axios';\r\n\r\naxios.defaults.headers.post['X-XSRF-TOKEN'] = Athliit.token;\r\naxios.defaults.xsrfHeaderName = null;\r\n\r\nexport default axios;`\r\n\r\nThe reason why I am overwritting the \"xsrflHeaderName\" is that in my project I supply my own token and therefore had to deactivate the default token. I did this by making it `null` and this apparently caused an error in IE.\r\n\r\nInstead I just renamed it to some random string: \r\n\r\n`axios.defaults.xsrfHeaderName = 'xsrf_default_overwritten';`\r\n\r\n**And then it worked! **\r\n\r\nSo the problem wasn't directly caused by axios but the reason I had to overwrite it was (as mentioned earlier) that axios suplies it's own token and I needed to use my own like this:\r\n\r\n`axios.defaults.headers.post['X-XSRF-TOKEN'] = App.token;`\r\n\r\nNow, I am not aware of any obvious solutions to this problem already provided by axios, so please refer me if so. \r\n\r\nIf not; maybe the default token should be overwritten when I set my own custom token under the same name.\r\n\r\nThanks for a good library though and I am just glad that I found the bug so I can continue using it :-) 👍 "}}