question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

9reactions
bryancalistocommented, Jan 29, 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.

6reactions
kader-invictuscommented, Jun 8, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't resolve 'fs' in react-script - Stack Overflow
Edit: I just found out that I can't create Excel files anymore. After some research, it seems that 'fs' (which is used to...
Read more >
Module not found: Can't resolve 'fs' error [Solved] | bobbyhadz
The error "Module not found: Error: Can't resolve 'fs'" occurs because there has been a breaking change in Webpack version 5. To solve...
Read more >
module not found: can't resolve 'fs' in - You.com
1 Answer. Sorted by: 1. fs is a nodeJs only module. When you run "ng serve" your app will be compiled and run...
Read more >
Module not found: Error: Can't resolve 'fs' - Laracasts
hi, when run gulp get error not found fs module // depend fs let dir = require('node-dir'); //or let fs = require('fs'); dir.path(__dirname,...
Read more >
[Gatsby, Storyblok] "Can't resolve 'fs' in x" - DEV Community ‍ ‍
ERROR #98124 WEBPACK Generating development JavaScript bundle failed Can't resolve 'fs' in '/Users/.../node_modules/dotenv/lib' If you're ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found