libarchivejs icon indicating copy to clipboard operation
libarchivejs copied to clipboard

Archive.open() is freezing and gives no error or results

Open DaCao opened this issue 3 years ago • 0 comments

import { Archive } from 'libarchive.js/main.js';

Archive.init({
    workerUrl: 'libarchive.js/dist/worker-bundle.js'
});


export const handleFile = async (file) => {
  console.log('file: ', file)
  console.log('_7zOpen !! ')

  const archive = await Archive.open(f);
  console.log('archive: ', archive)

  const filesObject = await archive.getFilesObject();
  console.log("filesObject: ", filesObject)

  const filesArray = await archive.getFilesArray();
  console.log("filesArray: ", filesArray)

  return filesArray
}

This runs, but the console output only print out file and _7zOpen !! and then just stops there without any further response. No error is thrown, and the line console.log('archive: ', archive) never gets executed.

console log output:

file:  File {path: 'CE027001-120011101924-T100.7z', 
name: 'CE027001-120011101924-T100.7z', 
lastModified: 1599377977254, 
lastModifiedDate: Sun Sep 06 2020 16:39:37 GMT+0900, webkitRelativePath: '', …}
lastModified: 1599377977254
lastModifiedDate: Sun Sep 06 2020 16:39:37 GMT+0900 {}
name: "CE027001-120011101924-T100.7z"
path: "CE027001-120011101924-T100.7z"
size: 75602083
type: "application/x-7z-compressed"
webkitRelativePath: ""
[[Prototype]]: File

_7zOpen !! 

I suspect that the Archive object is never really running despite the fact that it is installed and imported with no problem.

What is going on? How can I move forward to debug this issue?

DaCao avatar Oct 12 '21 16:10 DaCao