From 3ac3b82f1ca3d5dac703bbabd28111f8f6b5e722 Mon Sep 17 00:00:00 2001 From: Jason Pickens Date: Sun, 28 Jan 2024 21:30:52 +1300 Subject: [PATCH] fix: log fatal query error Logs the error from the query if it cause the props to be null. --- src/renderElement.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/renderElement.tsx b/src/renderElement.tsx index 3604acb..3bb8108 100644 --- a/src/renderElement.tsx +++ b/src/renderElement.tsx @@ -31,6 +31,15 @@ Props) { return undefined; } + if (!props && error) { + if (process.env.NODE_ENV !== 'production') + console.error( + `Fatal error with query \`${querySubscription.getQueryName()}\`: ${error}.`, + ); + + return null; + } + if (!props || !hasComponent) { if (process.env.NODE_ENV !== 'production') console.error(