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

### Next.js API route error on Vercel - Unhandled Promise Rejection #52756

Closed
csvidit opened this issue Jul 16, 2023 · 3 comments
Closed

### Next.js API route error on Vercel - Unhandled Promise Rejection #52756

csvidit opened this issue Jul 16, 2023 · 3 comments
Labels

Comments

@csvidit
Copy link

csvidit commented Jul 16, 2023

Summary

The code works perfectly fine on my local machine using a development server, but on the deployed version on Vercel, the API route call always fails. For reference, I am on an M1 MacBook Air, 16 GB unified memory.

This is the code for the project - https://github.com/csvidit/turbobiz

This is the link to the production build, hosted on Vercel - https://turbobiz.viditkhandelwal.com

This is the error I get in the Serverless Function logs on Vercel -

Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: EMFILE: too many open files, open '/var/task/node_modules/@firebase/auth/dist/node-esm/index.js'","reason":{"errorType":"Error","errorMessage":"EMFILE: too many open files, open '/var/task/node_modules/@firebase/auth/dist/node-esm/index.js'","code":"EMFILE","errno":-24,"syscall":"open","path":"/var/task/node_modules/@firebase/auth/dist/node-esm/index.js","stack":["Error: EMFILE: too many open files, open '/var/task/node_modules/@firebase/auth/dist/node-esm/index.js'"," at Object.openSync (node:fs:601:3)"," at Object.readFileSync (node:fs:469:35)"," at Module._extensions..js (node:internal/modules/cjs/loader:1271:18)"," at Module.load (node:internal/modules/cjs/loader:1117:32)"," at Module._load (node:internal/modules/cjs/loader:958:12)"," at ModuleWrap. (node:internal/modules/esm/translators:169:29)"," at ModuleJob.run (node:internal/modules/esm/module_job:194:25)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: EMFILE: too many open files, open '/var/task/node_modules/@firebase/auth/dist/node-esm/index.js'"," at process. (file:///var/runtime/index.mjs:1189:17)"," at process.emit (node:events:525:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Unknown application error occurred
Runtime.Unknown

I have spent 4 hours searching for fixes, but nothing has worked yet. Let me know if you need any more information or context.

Additional information

No response

Example

No response

Originally posted by @csvidit in #52755

@masterkain
Copy link

perhaps related #52646

@csvidit
Copy link
Author

csvidit commented Jul 18, 2023

SOLVED: It was an issue with the @phosphor-icons/react library. Anyone else who is having the same issue, please consider switching to react-icons, which has also has all phosphor icons.

@csvidit csvidit closed this as completed Jul 18, 2023
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants