fs in _document.js
See original GitHub issue[x] I have searched the issues of this repository and believe that this is not a duplicate.
I try to use fs in _document.js, developement & build process is success, but when I tried to run in production mode. I got the message.
Error: EBADF: bad file descriptor, fstat
My understand. _document.js can use on _document.js because it only runs on server-side only right?
What else, I need to config
My Environment
Tech | Version |
---|---|
next | 5.1 |
node | 8.9.3 |
OS | OSX |
browser | Chrome |
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
File system | Node.js v19.3.0 Documentation
The fs/promises API provides asynchronous file system methods that return promises. The promise APIs use the underlying Node.js threadpool to perform file ...
Read more >Node.js File System Module - W3Schools
The fs.readFile() method is used to read files on your computer. ... The fs.appendFile() method appends specified content to a file.
Read more >Fs - node - Read the Docs
writeFile(filename, data[, options], callback) Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or...
Read more >How To Work with Files using the fs Module in Node.js
With Node.js, you can programmatically manipulate files with the built-in fs module. The name is short for “file system,” and the module ...
Read more >Node.js fs.readdir() Method - GeeksforGeeks
The fs.readdir() method is used to asynchronously read the contents of a given directory. The callback of this method returns an array of ......
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 FreeTop 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
Top GitHub Comments
@comus in development we do bundle it for the client side, the reason for this is hot reloading on _document.js
oh, sorry, seems like next.config.js must add fs: empty for import fs, not sure how it works