core icon indicating copy to clipboard operation
core copied to clipboard

fix (server-renderer): stability - stop server crashing with unhandled promise rejection

Open peteclark82 opened this issue 2 years ago • 0 comments

If an async component throws a template rendering error whilst another async component is being rendered it results in a unhandled promise rejection and the server crashing. This is because the async components are processed in a synchronous loop (via unrollBuffer) creating this race condition.

Much like if there are prefetches, we must explicitly add error handling to the promise. We are still returning the original promise so that the error handling hooks can still process the error correctly.

peteclark82 avatar Feb 06 '23 13:02 peteclark82