https://github.com/SheetJS/sheetjs/issues/418
This github issue seems to discuss issues around this error. Most commonly seems to be that the readFile function does not access local file system and it seems like you are trying to load from a local file system.
Here is a potential solution that I have used in the past to load an excel file then parse each sheet into json data. NOTE: this was in an angular 12 project but the same readExcel function can be used.
component.html code:
<input type="file" id="file" multiple (change)="readExcel($event)">
component.ts code:
import { Component } from '@angular/core';
import * as XLSX from 'xlsx';
@Component({
selector: 'my-app',
styleUrls: ['./app.component.scss'],
templateUrl: './app.component.html',
})
export class AppComponent {
readExcel(event) {
const file = event.target.files[0];
const reader: FileReader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = (e: any) => {
// upload file
const binarystr = new Uint8Array(e.target.result);
const wb: XLSX.WorkBook = XLSX.read(binarystr, { type: 'array', raw: true, cellFormula: false });
console.log(wb.Sheets)
const wsname = wb.SheetNames[0];
const data = XLSX.utils.sheet_to_json(wb.Sheets[wsname]);
console.log(data)
}
}
}
Below is a screenshot of the test data I used from a test excel file that had two sheets in it with a 3x3 matrix of data on each sheet.

Below is a screenshot of the .json output form the .ts and .html code above when I uploaded the test excel file.
