Can't use fs module in the static.config.js file
See original GitHub issueI wanted to create markdown files inside a folder, but when I tried to use the fs module (or fs-extra) the build process fails.
Minimum steps:
Add import fs from 'fs'
to the static.config.js
file
$ yarn start
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Module not found: Can't resolve 'fs' in Next.js application
If you use fs , be sure it's only within getInitialProps or getServerSideProps . (anything includes server-side rendering).
Read more >Can't use fs module in the static.config.js file · Issue #6 - GitHub
I wanted to create markdown files inside a folder, but when I tried to use the fs module (or fs-extra) the build process...
Read more >Can't resolve 'fs' error in Next.js and WebPack - Nsikak Imoh
The Module not found: Can't resolve 'fs' in Next.js error occurs when you import a Node.js module that is available on the server-side,...
Read more >How To Solve Module Not Found Can't Resolve 'fs' in Next.js
This error seems straightforward: the filesystem module is not found. Maybe it was not installed or something like that. However, what made this ......
Read more >Module not found | Can't resolve 'fs' in Next js application
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should be good now. Confirm again?
This should be fixed in the latest release (4b2a6db50ff48e6f21f71033a7a6ced623fa6839, react-static@1.0.41). Can either of you confirm?