Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
Reading excel file in react js electron project

Totally lost here. Tried many different things, but nothing worked. I have a react js electron project, where i need to use some data from excel file. I installed xlsx module. However, got stuck when trying to read file from the component. It works well when I upload the file. But i need file to be in the folder. File is located in folder called "files", the file name is "rent.xlsx" Component is in the same folder as "files" folder, so path should be "./files/rent.xlsx" However, it doesnt read file. Here is the code:

const workbook = XLSX.read("/files/rent.xlsx", { type: "array" });
const sheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[sheetName];
const json: any = XLSX.utils.sheet_to_json(worksheet)

As i have mentioned, reading from uploaded file works well. So, code is OK. This part must be wrong:

XLSX.read("/files/rent.xlsx", { type: "array" });

Please, advise what should i do? Am i missing some libraries or modules? Been looking on stackoverflow, but didnt find anything Thanks!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda