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

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 =;
        const vtkReader = vtk.IO.XML.vtkXMLPolyDataReader.newInstance();
        const vtkData = vtkReader.getOutputData(0);
        if (vtkData) {
        } else {
          handleError(new Error("Failed to load VTK data"));
      reader.onerror = handleError;

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!