Bug: Error: EMFILE: too many open files, open 'C:\xxx\web\build\static\js\main.b1a04325.chunk.js'
See original GitHub issueI use serve
to serve my React app because this docs said so: https://create-react-app.dev/docs/deployment/
React version: 16.12.0 OS: Win 10 x64
Steps To Reproduce
- Create a React app.
- Let a lot of users use it.
The current behavior
After dozens of minutes of access (~ 20 requests/second), I always encounter such error. It seems that too many people are reading the static files.
Microsoft Windows [Version 10.0.17763.914]
(c) 2018 Microsoft Corporation
C:\xxx\web>serve -s build -l 6001
C:\xxx\web>"node" "C:\Users\Administrator\AppData\Roaming\npm\\node_modules\serve\bin\serve.js" -s build -l 6001
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Serving! β
β β
β - Local: http://localhost:6001 β
β - On Your Network: http://172.17.10.7:6001 β
β β
β Copied local address to clipboard! β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
INFO: Gracefully shutting down. Please wait...
events.js:187
throw er; // Unhandled 'error' event
^
Error: EMFILE: too many open files, open 'C:\xxx\web\build\static\js\main.b1a04325.chunk.js'
Emitted 'error' event on ReadStream instance at:
at internal/fs/streams.js:120:12
at FSReqCallback.oncomplete (fs.js:146:23) {
errno: -4066,
code: 'EMFILE',
syscall: 'open',
path: 'C:\\xxx\\web\\build\\static\\js\\main.b1a04325.chunk.js'
}
The expected behavior
No error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Error: EMFILE: too many open files, open 'C:\xxx\web\build ...
Bug: Error: EMFILE: too many open files, open 'C:\xxx\web\build\static\js\main.b1a04325.chunk.js' #17866.
Read more >node and Error: EMFILE, too many open files - Stack Overflow
This command will output the number of open handles for nodejs processes: ... Using the graceful-fs module by Isaac Schlueter (node.js maintainer) isΒ ......
Read more >Unable to deploy Angular .NET Core 3,1 Web App to Azure ASE
I am using "Deploy Node.js app to Azure App Service". This is the error I am getting: Error: EMFILE: too many open files,...
Read more >Fix 'EMFILE: too many open files' error in Jest - SeanMcP.com
When trying to run Jest in watch mode, this error may mean that you are missing a dependency.
Read more >Error: EMFILE: too many open files - Expo forums
Running 'expo start' suddenly gives this error: Expo Press ? to show a list of all available commands. Logs for your project will...
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
Hello, I am not sure this bug should be closed, even if itβs not suitable for production. It should correctly closes files
Finally I used
waitress