vue-pdf-embed
vue-pdf-embed copied to clipboard
HMR support broken
For some reason every time my container module is updated, vue-pdf-embed refuses to load the document. As if it has a memory that it already loaded it, but hasn't actually. To reproduce just make a one line script change, white space works. Vite will then HMR your component and the pdf will not load, despite having a valid URL.
My workaround is to use an objectUrl as source...
const fetchRes = await fetch(this.source)
const pdfBlob = await fetchRes.blob()
this.pdfObjectUrl = window.URL.createObjectURL(pdfBlob) // src
[Reproduction](https://stackblitz.com/edit/vue-pdf-embed?file=README.md,src%2FApp.vue)