I have a local file in the 'public' directory and am attempting to unzip it with jszip
:
import JSZip from 'jszip';
import myZip from '../public/test.zip';
function App() {
const zip = new JSZip();
zip.loadAsync(myZip)
.then(function (zip) {
console.log(zip)
});
// render function
}
but I'm getting the following error: Error: Can't find end of central directory : is this a zip file?
I am assuming that a) the file is being imported properly and possibly b) that I am misusing the loadAsync
function.