ngx-excel-export
ngx-excel-export copied to clipboard
Can't resolve 'fs' in xlsx-style
Hi, I'm using angular 6 and I can export json data with XLSX using ngx-excel-export.
When I try to style the exported excel document through xlsx-style, I get building errors:
`WARNING in ./node_modules/xlsx-style/xlsx.js Module not found: Error: Can't resolve 'crypto' in 'D:\Web\node_modules\xlsx-style'
ERROR in ./node_modules/xlsx-style/xlsx.js Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style' ERROR in ./node_modules/xlsx-style/ods.js Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style'`
How can I solve that?
Thanks PS: I'm not using node or webpack, it's a simple angular application.
same issue
any solution?
Facing same issue in Angular 6 project. Any solution for this?
same issue. Any solution for this? @vixper @ShubhamJainSJ
Same issue, any solution???
@ShivaInnovation
Hi, I've solved my problem with another library. I used exceljs.
https://github.com/guyonroche/exceljs#styles
Your code sample is this source https://www.ngdevelop.tech/export-to-excel-in-angular-6/
good luck
Facing the same issue with Angular 6, any solution ?
Any solutions found? (aside from switching to a different module)
same issue with Angular 7, any solution ?
@vixper
`WARNING in ./node_modules/xlsx-style/xlsx.js Module not found: Error: Can't resolve 'crypto' in 'D:\Web\node_modules\xlsx-style'
to solve this issue , i modified source code of 'xlsx-style/dist/cpexcel.js' from var cpt = require('./cpt' + 'able');
to var cpt = cptable
ERROR in ./node_modules/xlsx-style/xlsx.js Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style' ERROR in ./node_modules/xlsx-style/ods.js Module not found: Error: Can't resolve 'fs' in 'D:\Web\node_modules\xlsx-style'`
for these two issues , i solved by adding node attribute to 'webpack.config.js',like this
node: {
fs: "empty"
}
One passible reason here is the webpack treat 'fs' as package module but not node module
in my project webpack.config.js doesnt exist. how can i fix it ?
在我的项目中 webpack.config.js 不存在。我该如何解决?
这里说的是自己项目的webpack.confog.js,而不是xlsx-style的,你可以自己在项目根目录新建一个webpack.config.js,让你在打包的时候自动正确识别fs。
in my project webpack.config.js doesnt exist. how can i fix it ?
Did you find any solutions?