title: javascript error when downloading pdf file (blob)
body: <p>I am using this approach for downloading a pdf file from server (laravel 8 (api sanctum) + vue 3)</p>
  <p>In the vue component I have this function that downloads the file</p>
  <pre><code>const onDownloadDocument = (id) =&gt; {           
     axios.post('/api/document/download', {id: id},{
       responseType: 'blob'
     }).then(response =&gt; {
       let filename = response.headers['content-disposition'].split('filename=')[1]               
       dLink.value.href = window.URL.createObjectURL(response.data)
       dLink.value.setAttribute('download',filename)
       dLink.value.click()
     }).catch(error =&gt; {
        console.log(error)
     })
  </code></pre>
  <p>where dLink is a link ref</p>
  <pre><code>const dLink = ref(null)
  </code></pre>
  <p>in template:</p>
  <pre><code>&lt;a ref=&quot;dLink&quot;/&gt;
  </code></pre>
  <p>It works this approach until today.... after I updated the project (composer update and npm update)</p>
  <p>Now when click to download the file (call the onDownloadDocument function) I get an error:</p>
  <pre><code>contract.js:1049 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'responseType')
  </code></pre>
  <p>Any idea why ?</p>
  <p>The api backend return the file blob</p>
  <pre><code>return Storage::download($document-&gt;filename);
  </code></pre>