Our DevOps team informed us that they will be upgrading all servers to Node 18. But our app was working properly only with Node 16. So I upgraded CRA to latest version and at first it seems fine. But then random "Uncaught runtime errors" overlay messages begin popping up in development mode. They are completely random, when I click a link sometimes it shows up, the next time it doesn't show up. I can't find the source of the problem according to error messages. Message are always like this:
Uncaught runtime errors:
×
ERROR
Cancel
at handleError (http://localhost:3000/static/js/bundle.js:614149:58)
at http://localhost:3000/static/js/bundle.js:614172:7
When I look at console, it is like this:
Uncaught (in promise)
Cancel {message: undefined}
message: undefined
[[Prototype]]: Object
When I look at the specified rows at bundle.js, they are like this:
bundle.js:614149:58
var handleError = function handleError(error, fallbackMessage) {
**var errorObject = error instanceof Error ? error : new Error(error || fallbackMessage);**
var shouldDisplay = typeof options.catchRuntimeError === "function" ? options.catchRuntimeError(errorObject) : true;
if (shouldDisplay) {
overlayService.send({
type: "RUNTIME_ERROR",
messages: [{
message: errorObject.message,
stack: (0,_overlay_runtime_error_js__WEBPACK_IMPORTED_MODULE_1__.parseErrorToStacks)(errorObject)
}]
});
bundle.js:614172:7
(0,_overlay_runtime_error_js__WEBPACK_IMPORTED_MODULE_1__.listenToUnhandledRejection)(function (promiseRejectionEvent) {
**var reason = promiseRejectionEvent.reason;**
handleError(reason, "Unknown promise rejection reason");
});