I am trying to write on an existing excel file where my data is coming as a json format. I want to load the excel file then write on it and then have to download it. I have searched a lot and there are lots of solution but they are not working for me. People are using xlsx, sheetjs to solve that type of problem .Now I just want to read my excel file but when I try read the file , it throw me the below error attached image
import logo from './logo.svg';
import './App.css';
import excel from 'xlsx';
function App() {
const read_file=()=>{
console.log("hi")
var wb = excel.readFile('Book1.xlsx')
console.log(wb)
}
return (
<div className="App">
<button type="button" onClick={read_file()}>button</button>
</div>
);
}
export default App;