diff --git a/src/app/(space)/ClientContexts.tsx b/src/app/(space)/ClientContexts.tsx index 11870d518..a1a8f9720 100644 --- a/src/app/(space)/ClientContexts.tsx +++ b/src/app/(space)/ClientContexts.tsx @@ -14,7 +14,16 @@ export function ClientContexts(props: { forcedTheme: CustomizationThemeMode | undefined; children: React.ReactNode; }) { - const { nonce, children, forcedTheme, language } = props; + const { children, forcedTheme, language } = props; + + /** + * A bug in ThemeProvider is causing the nonce to be included incorrectly + * on the client-side. Original issue: https://github.com/pacocoursey/next-themes/issues/218 + * + * This is a workaround for it, until next-themes fixes it in their library. There is already + * a PR: https://github.com/pacocoursey/next-themes/pull/223 + */ + const nonce = typeof window === 'undefined' ? props.nonce : ''; return (