react-data-export icon indicating copy to clipboard operation
react-data-export copied to clipboard

Module not found can't resolve 'fs' in node_modules\tempa-xlsx

Open Srivastava295 opened this issue 3 years ago • 13 comments

We tried updating react-scripts from 4.0.3 to 5.0.0 with react-data-export 0.6.0 and xlsx 0.17.2, and when we try to build it fails with the error Module not found: Error: Can't resolve 'fs' in react-data-export\node_modules\tempa-xlsx

What fix needs to be applied to maintain react-scripts version 5.0.0? Thanks!

Srivastava295 avatar Dec 16 '21 08:12 Srivastava295

@Srivastava295 I have also the same problem. I tried to use older version but it is still the same. Do you have any workaround to solve this problem?

Thanks!

doraemonxxx avatar Jan 11 '22 14:01 doraemonxxx

I'm having this problem too. I made the build work by adding this lines to the 'resolve' field of webpack.config.js file (which is located in node_modules/react-scripts/config):

fallback: { "fs": false, "crypto": false },

imagen

Of course, this is a temporary fix.

The problem can be fixed definitively by replacing tempa-xlsx with xlsx in the package's source code. I'll try to make a pull request fixing it soon.

bryancalisto avatar Jan 15 '22 00:01 bryancalisto

Any updates for the fix? Also will I be able to export if I add the above code?

kaustubherttre avatar Mar 22 '22 06:03 kaustubherttre

Any updates for the fix? Also will I be able to export if I add the above code?

I guess the package is not being maintained anymore. If you add the above code, it will work as long as you don't cause your webpack.config.js file to lose the added lines (e.g. by re-creating your node_modules). This may make it difficult to use this package in a continuous integration environment, because of the manual edit of webpack.config.js you have to make

bryancalisto avatar Mar 23 '22 03:03 bryancalisto

used this package somtimes last year and it worked, @bryancalisto your fix doesnt seems to be working anymore. any help,

tdammy92 avatar May 28 '22 22:05 tdammy92

Any updates?

aviyi avatar May 29 '22 09:05 aviyi

Any updates?

I switched from NPM to YARN and everything works perfectly. NPM has a lot of problems, try switching to YARN if you can. Maybe it can solve your problem

kadecode7 avatar Jun 08 '22 12:06 kadecode7

Installing the xlsx package fixes it

npm i xlsx

alkanpolat avatar Feb 01 '23 08:02 alkanpolat

Hi guy, any fix on this bug yet?

jsoftwares avatar Apr 04 '23 06:04 jsoftwares

Adding "browser": { "fs": false, }, in the package.json file fixed it for me.

Natnaelh avatar Jun 15 '23 21:06 Natnaelh

Installing the xlsx package fixes it

npm i xlsx

@alkanpolat comment resolve my issue.

IamAhsanMani avatar Jan 07 '24 12:01 IamAhsanMani

i try all above solution still facing same issue

Pratiktarade avatar Jan 09 '24 07:01 Pratiktarade

Adding "browser": { "fs": false, }, in the package.json file fixed it for me.

resolve my issue.

pardo024 avatar Mar 20 '24 21:03 pardo024