Open ogodon opened 5 years ago
Hi @ogodon, you need to explicitly define fs
in configuration file, for example, in case of webpack, add following lines to your webpack.config.js
file,
.....
node: {fs: 'empty'},
externals: [
{'./cptable': 'var cptable'},
{'./jszip': 'jszip'}
]
Hope that will help.
I have the same error. I created a react app using create-react-app. The didn npm run eject. Added the above configs to webpack.config.js. And still get the error.
Failed to compile.
./node_modules/tempa-xlsx/ods.js
Module not found: Can't resolve 'xlsx' in 'C:\Projects\my-app\node_modules\tempa-xlsx'
@xariaSg npm install xlsx --save
solved it for me.
@xariaSg
npm install xlsx --save
solved it for me.
The whole purpose of react-data-export is "(❗️❗️❗️The purpose of having a new library is that open source libraries either does not support styling and rest functionality in excel or they are too heavy to consider)". xlsx module is a heavy one. It has a size of 10MB. So this shouldn't be a proper solution.
Hi @ogodon, you need to explicitly define
fs
in configuration file, for example, in case of webpack, add following lines to yourwebpack.config.js
file,..... node: {fs: 'empty'}, externals: [ {'./cptable': 'var cptable'}, {'./jszip': 'jszip'} ]
Hope that will help.
Hi!
I created my project with create-react-app and didn't find where to add this setting to solve the problem.
How i can do this?
Hi @ogodon, you need to explicitly define
fs
in configuration file, for example, in case of webpack, add following lines to yourwebpack.config.js
file,..... node: {fs: 'empty'}, externals: [ {'./cptable': 'var cptable'}, {'./jszip': 'jszip'} ]
Hope that will help.
Hi!
I created my project with create-react-app and didn't find where to add this setting to solve the problem.
How i can do this?
You can check out this: https://github.com/securedeveloper/react-data-export/issues/168#issuecomment-1013556528
Hello,
I'm trying to use this exciting library. After installing the react-data-export package in my existing react application I get an error when I import the package by using
import ReactExport from 'react-data-export';
I have the following error.
Module fs cannot be found. So my question would be : is this package only meant to be used on a server context ?
Thank you for your time.