From 54343aa685ae8f33159d2f485ec4a57bad5c574a Mon Sep 17 00:00:00 2001 From: Robert Harrison Date: Sun, 20 Sep 2026 02:17:32 -0600 Subject: [PATCH] fix: restore @ts-expect-error for CacheProvider type mismatch (#30171) * fix: restore @ts-expect-error for CacheProvider type mismatch PR #30140 removed these comments assuming they were stale now that the repo is on TypeScript 5. The comments were about the compiler version, but the actual incompatibility is between react-inlinesvg/provider's CacheProvider (typed to return a bare ReactNode) and this repo's pinned @types/react@18.0.26, which requires JSX components to return Element | null. ReactNode includes undefined, so the JSX usage fails type-checking. Verified yarn build completes successfully with this restored. Fixes #30170 * docs: explain the actual @ts-expect-error compatibility condition Per @coderabbitai review on #30171: the old wording ("remove when upgrading typescript to v5") was itself stale/misleading, since the incompatibility is with the pinned @types/react version, not the TypeScript compiler version. Documents the real condition instead. --- apps/web/app/providers.tsx | 1 + apps/web/pages/_app.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/web/app/providers.tsx b/apps/web/app/providers.tsx index eec350d978..4207ffd214 100644 --- a/apps/web/app/providers.tsx +++ b/apps/web/app/providers.tsx @@ -27,6 +27,7 @@ export function Providers({ isEmbed, children, country }: ProvidersProps) { {!isEmbed && !isBookingPage && } + {/* @ts-expect-error react-inlinesvg/provider is incompatible with @types/react@18.0.26. Remove when these types are compatible. */} {children} diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index 10f9db9ddf..b8ff80506e 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -17,6 +17,7 @@ function MyApp(props: AppProps) { return ( + {/* @ts-expect-error react-inlinesvg/provider is incompatible with @types/react@18.0.26. Remove when these types are compatible. */} {Component.PageWrapper ? : }