Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Srivastava295 opened this issue Dec 16, 2021 · 13 comments
Open

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

Srivastava295 opened this issue Dec 16, 2021 · 13 comments

Comments

@Srivastava295
Copy link

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!

@doraemonxxx
Copy link

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

@bryancalisto
Copy link

bryancalisto commented Jan 15, 2022

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.

@kaustubherttre
Copy link

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

@bryancalisto
Copy link

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

@tdammy92
Copy link

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

@aviyi
Copy link

aviyi commented May 29, 2022

Any updates?

@k4derdiarra
Copy link

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

@alkanpolat
Copy link

alkanpolat commented Feb 1, 2023

Installing the xlsx package fixes it

npm i xlsx

@jsoftwares
Copy link

Hi guy, any fix on this bug yet?

@Natnaelh
Copy link

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

@IamAhsanMani
Copy link

Installing the xlsx package fixes it

npm i xlsx

@alkanpolat comment resolve my issue.

@Pratiktarade
Copy link

i try all above solution still facing same issue

@pardo024
Copy link

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

resolve my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests