diff --git a/node_package/src/buildConsoleReplay.ts b/node_package/src/buildConsoleReplay.ts index 638b8b251..35c33c035 100644 --- a/node_package/src/buildConsoleReplay.ts +++ b/node_package/src/buildConsoleReplay.ts @@ -24,7 +24,7 @@ export function consoleReplay(): string { if (val === undefined) { val = 'undefined'; } - } catch (e) { + } catch (e: any) { val = `${e.message}: ${arg}`; } diff --git a/node_package/src/clientStartup.ts b/node_package/src/clientStartup.ts index 9914814d1..024dc9ff8 100644 --- a/node_package/src/clientStartup.ts +++ b/node_package/src/clientStartup.ts @@ -174,7 +174,7 @@ You should return a React.Component always for the client side entry point.`); reactRender(domNode, reactElementOrRouterResult as ReactElement); } } - } catch (e) { + } catch (e: any) { e.message = `ReactOnRails encountered an error while rendering component: ${name}.\n` + `Original message: ${e.message}`; throw e; @@ -214,7 +214,7 @@ function unmount(el: Element): void { if(domNode === null){return;} try { ReactDOM.unmountComponentAtNode(domNode); - } catch (e) { + } catch (e: any) { console.info(`Caught error calling unmountComponentAtNode: ${e.message} for domNode`, domNode, e); } diff --git a/node_package/src/serverRenderReactComponent.ts b/node_package/src/serverRenderReactComponent.ts index eadd7d311..5477c0d19 100644 --- a/node_package/src/serverRenderReactComponent.ts +++ b/node_package/src/serverRenderReactComponent.ts @@ -83,7 +83,7 @@ as a renderFunction and not a simple React Function Component.`); } else { renderResult = processReactElement(); } - } catch (e) { + } catch (e: any) { if (throwJsErrors) { throw e; } @@ -115,7 +115,7 @@ as a renderFunction and not a simple React Function Component.`); consoleReplayScript, hasErrors, }; - } catch (e) { + } catch (e: any) { if (throwJsErrors) { throw e; }