From 1b8573228eb2f60043ebfd2c7fe7cf59ff357b1e Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Wed, 11 Mar 2026 11:11:41 +0100 Subject: [PATCH] fix: add ErrorBoundary to Search modal and fix MobileMenu error recovery The SearchModal is dynamically imported and can fail with ChunkLoadError when the webpack runtime references stale chunk hashes after a deploy (Next.js 14 App Router bug: vercel/next.js#78756). Without an error boundary, this crashes the entire React tree and shows a black screen. - Wrap SearchModal with ErrorBoundary showing a recovery dialog - Fix MobileMenu error fallback to use page reload instead of reset, since reset just re-triggers the same failed import --- .../Nav/MobileMenu/MobileMenuClient.tsx | 6 ++-- src/components/Search/index.tsx | 30 ++++++++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/components/Nav/MobileMenu/MobileMenuClient.tsx b/src/components/Nav/MobileMenu/MobileMenuClient.tsx index 3926cfba414..9907d748371 100644 --- a/src/components/Nav/MobileMenu/MobileMenuClient.tsx +++ b/src/components/Nav/MobileMenu/MobileMenuClient.tsx @@ -107,15 +107,15 @@ const MobileMenuClient = ({ className, side }: MobileMenuClientProps) => { > {hasBeenOpened && ( ( + fallback={() => (

{t("loading-error")}

+ +
+
+ + )} + > + +
+ )} )