The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType
See original GitHub issueSummary
I literally copied and pasted the “stream” example and I get the following error:
// GET request for remote image
axios({
method:'get',
url:'http://bit.ly/2mTM3nY',
responseType:'stream'
})
.then(function(response) {
response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
});
Context
- axios version: v0.17.1
- Environment: node v8.2.1, Electron 1.8.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:14
Top Results From Across the Web
Using Axios to return stream from Express app
Using Axios to return stream from Express app -- "The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType.".
Read more >XMLHttpRequest.responseType - Web APIs | MDN
The XMLHttpRequest property responseType is an enumerated string value specifying the type of data contained in the response.
Read more >The provided value 'undefined' is not a valid enum value of ...
I'm having a problem to upload my profile image in my application, and I can't figure out why. I published to my images...
Read more >Photon not working: (frustration) options? - Particle Community
[sm]:42713 The provided value 'ms-stream' is not a valid enum value of type XMLHttpRequestResponseType. bundle.js? [sm]:42713 The provided value ...
Read more >XMLHttpRequest · Adobe XD Plugin Reference
The default value is 0, which means there is no timeout. ... taken from the XMLHttpRequestResponseType enum which specifies; what type of data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m getting this error in web using Vue.
axios.request({
method: 'POST',
url: 'http://apilink/endpoint',
data: form,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'stream', // HERE
})
.then(response => {
console.log('LOGIN response', response);
})
.catch(error => {
console.log('LOGIN error', error);
});
@nbcnc I figured it out, your making an electron app like me. seems you can only get the response.data as a stream in the main thread. What I did to fix this was add
then in the main thread
good luck