next.js
fc3c96d3 - Fix unhandled rejection in proxy-request (#72530)

Commit
1 year ago
Fix unhandled rejection in proxy-request (#72530) Trying to fix : https://github.com/vercel/next.js/issues/72522 ### What? The finally method actually creates a new promise. You have to listen to this new promise instead of the original one or you might end up with unhandled rejection. Taken from the documentation : > The finally() method of [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) instances schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns another [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) object, allowing you to [chain](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. ### Why? see : https://github.com/vercel/next.js/issues/72522 ### How? Fixes : https://github.com/vercel/next.js/issues/72522 Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
Parents
Loading