reading a .vtk data using vtk.js (locally)

Hello,
I am trying to read .vtk data using vtk.js, and this data is uploaded by the user locally (this data is a 3D model), and I get the error as shown in the attached photo.

else if (isVTK) {
      console.log("Attempting to read VTK file:", file[0]);

      const reader = new FileReader();
      reader.onload = (event) => {
        const arrayBuffer = event.target.result;
        const vtkReader = vtk.IO.XML.vtkXMLPolyDataReader.newInstance();
        vtkReader.parseAsArrayBuffer(arrayBuffer);
        const vtkData = vtkReader.getOutputData(0);
        if (vtkData) {
          handleVTKData(vtkData);
        } else {
          handleError(new Error("Failed to load VTK data"));
        }
      };
      reader.onerror = handleError;
      reader.readAsArrayBuffer(file[0]);
    }

vtkXMLPolyDataReader is for vtp format not vtk. Also vtk.js does not support Unstructured grid anyway. But you can use wasm to load the file and convert it into a polydata. If you use Glance, you should be able to load your file.

Thank you for your answer!