mgcrea / node-xlsx

NodeJS excel file parser & builder
Other
2.96k stars 274 forks source link

TypeError: input.replace is not a function #174

Closed colo13verdadeo closed 1 year ago

colo13verdadeo commented 2 years ago
               input = input.replace(/[^\w\+\/\=]/g, "");
                                  ^

TypeError: input.replace is not a function

Code:


const fs = require('fs')

//Cierra dependencias

function importar(ruta){
    archivo = XLSX.readFile(ruta) 
    hojas = archivo.SheetNames;
    console.log(hojas)
    datos = XLSX.utils.sheet_to_json(archivo.Sheets[hojas[0]])
    console.log(datos)
    console.log()
    for(itemfila of datos){
    console.log(datos['Usuarios'])}
}

console.log(xlsx.parse(`./importarexcel.xlsx`))```
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

binajmen commented 2 years ago

Hello @colo13verdadeo, I have the same issue (https://github.com/mgcrea/node-xlsx/issues/182). Did you find a solution?

@mgcrea Any idea? Your library worked very well in a local node, but doesn't seem to like being migrated in a Remix (https://remix.run) project :S

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

brayanL commented 12 months ago

I'm still getting this error, any solution? My app crashed in this line. XLSX.read(file);

colo13verdadeo commented 10 months ago

No @binajmen :c

Jmennius commented 1 month ago

Had the same issue when working with a data buffer provided by cypress. In my case the buffer was actually an ArrayBuffer (as provided by cypress). So to make it work with xlxs I had to convert it to a regular Buffer: Buffer.from(array_buffer).