protobi / js-xlsx

XLSX / XLSM / XLSB (Excel 2007+ Spreadsheet) / ODS parser and writer
http://oss.sheetjs.com/js-xlsx
Other
814 stars 416 forks source link

Package error FS #141

Open parlay96 opened 4 years ago

parlay96 commented 4 years ago

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

JonnoFTW commented 4 years ago

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.

parlay96 commented 4 years ago

@JonnoFTW So how to solve it?

JonnoFTW commented 4 years ago

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

parlay96 commented 4 years ago

@JonnoFTW Thank you, but I currently use https://github.com/livelypeng/pl-export-excel

parlay96 commented 4 years ago

ok, Thank you, but I currently use https://github.com/livelypeng/pl-export-excel

------------------ 原始邮件 ------------------ 发件人: "Jonathan Mackenzie"<notifications@github.com>; 发送时间: 2020年3月30日(星期一) 下午2:06 收件人: "protobi/js-xlsx"<js-xlsx@noreply.github.com>; 抄送: "Simple love"<403802162@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [protobi/js-xlsx] Package error FS (#141)

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ikochetkov commented 3 years ago

Does someone know how to solve this FS?

JonnoFTW commented 3 years ago

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

ikochetkov commented 3 years ago

@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...

JonnoFTW commented 3 years ago

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 https://github.com/protobi/js-xlsx/issues/141#issuecomment-814066520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6YSTHK64DXKUUFKNEFB3THL2LFANCNFSM4KFVNAWA .

ikochetkov commented 3 years ago

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...

ikochetkov commented 3 years ago

@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!