protobi/js-xlsx

Package error FS

parlay96 opened this issue · 11 comments

ERROR in ./node_modules/xlsx-style/xlsx.js
Module not found: Error: Can't resolve 'fs' in 'G:\pl-e\node_modules\xlsx-style'
@ ./node_modules/yxg-xlsx-style/xlsx.js 1204:27-40 1340:8-24
@ ./index.js

I also experience this error when trying to build into an ember-cli app. I don't need fs features so it would be nice if it was optional when building.

@JonnoFTW So how to solve it?

No idea, I'm going to look at this https://github.com/protobi/msexcel-builder as an alternative

Does someone know how to solve this FS?

@ikochetkov I just switched to the library I linked. Most of these excel output libraries are quite similar so it's not difficult.

@ikochetkov I just switched to the library I linked. Most of these excel output libraries are quite similar so it's not difficult.

I'm looking for something to run through a browser, and msexcel-builder seems only can be done server-side. xlsx successfully works for me through browser, but I need to add some styles...

I've used it in browser, the first example in the repo shows you how to do this.

On Tue, 6 Apr 2021, 9:36 pm Igor Kochetkov, @.***> wrote: @ikochetkov https://github.com/ikochetkov I just switched to the library I linked. Most of these excel output libraries are quite similar so it's not difficult. I'm looking for something to run through a browser, and msexcel-builder seems only can be done server-side. xlsx successfully works for me through browser, but I need to add some styles... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#141 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6YSTHK64DXKUUFKNEFB3THL2LFANCNFSM4KFVNAWA .

Hmmm, I downloaded that 3 files from old commit and imported them to my page where I'm calling right now just - 'var workbook = excelbuilder.createWorkbook()', but on compilation webpack says that 'fs' not found again, and I looked into msexcel-builder.js and there is line 'return require('fs').writeFile(target, buffer, cb);' Why fs still there...

@JonnoFTW I got it running, I haven't uninstall it through npm while using imported scripts, so I uninstalled npm package and just imported js files into my project, and changed ways in msexcel-builder from xml = require('xmlbuilder'); to xml = require('./xmlbuilder'); and it's running now...going to look into styling. Thank you for assist!