title: Using Axios to return stream from Express app -- "The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType."
body: <p>I'm learning Node, Express and React and am trying to convert a simple generic Fetch method that I use to call my Express API to Axios.  I've gotten Axios to work when I want it to automatically return the result as JSON data, but here I want it to return a <code>ReadableStream</code>.  From the documentation it should be simple: simply add the field <code>responseType:'stream'</code> to the <code>config</code> but I keep getting the error <code>The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType.</code>   I see that others have had this issue (see <a href="https://github.com/axios/axios/issues/1474" rel="nofollow noreferrer">https://github.com/axios/axios/issues/1474</a>)but I don't see any solution.  Does anyone know if there is one, or if I am doing something wrong?  The relevant code is below.  Thanks for any insights!</p>
  
  <pre><code>const logic = {
  
   _call(path, method, headers, body, expectedStatus) {
          const config = { method,responseType:'stream', url: `http://localhost:8080/${path}`}
  
          if (headers) config.headers = headers
          if (body) config.data = body
  
          return axios( config)
              .then(res =&gt; {
                  if (res.status === expectedStatus) {
                      return res
                  } else
                      return res
                          .then(({ message }) =&gt; {
                              throw new Error(message)
                          })
              })
      }
  }
  </code></pre>