Closed SentientBits closed 7 years ago
I get this as well - any news on this?
I'm having issues with this as well. Looking through the code, it appears that js-xlsx relies on Node's fs module. I'm not sure how that works (I'm fairly new to all of this), but I'm working on figuring out how to either pull in the fs module as a dependency or create my own wrapper that uses javascript's FileReader underneath (worst case scenario)
Also running into issues with this. If anyone figures out a good workaround, I'd love to know (and will likewise comment here I figure something out)
Look at #285
You can't use fs
or XLSX.readFile
in the browser. Use XLSX.read
. If you need specific examples, the demo http://oss.sheetjs.com/js-xlsx/ source is in the gh-pages branch of the repo. index.html
uses HTML5 File API and ajax.html
uses XMLHttpRequest
I have tried every combination I can think of yet I still get _TypeError: fs is undefined. Attached is the HTML file with embedded script.
Am I missing something??
index.txt
Full Stack Trace TypeError: _fs is undefined readSync()xlsx.full.min.js (line 18) readFileSync()xlsx.full.min.js (line 18) index.html()index.html (line 24) n.event.dispatch()jquery.min.js (line 3) n.event.add/r.handle()jquery.min.js (line 3)