diff --git a/frontend/src/metabase/styled-components/components/EmotionCacheProvider/EmotionCacheProvider.tsx b/frontend/src/metabase/styled-components/components/EmotionCacheProvider/EmotionCacheProvider.tsx index 45a2ae712cf519b93efef641fc6bb55236901e2f..4ba9e8af9b8277ce6e2ded540540f39e2fe23212 100644 --- a/frontend/src/metabase/styled-components/components/EmotionCacheProvider/EmotionCacheProvider.tsx +++ b/frontend/src/metabase/styled-components/components/EmotionCacheProvider/EmotionCacheProvider.tsx @@ -3,6 +3,8 @@ import { CacheProvider } from "@emotion/react"; import type { ReactNode } from "react"; import { useMemo } from "react"; +import { isCypressActive } from "metabase/env"; + interface EmotionCacheProviderProps { children?: ReactNode; } @@ -11,7 +13,11 @@ export const EmotionCacheProvider = ({ children, }: EmotionCacheProviderProps) => { const emotionCache = useMemo(() => { - const cache = createCache({ key: "emotion", nonce: window.MetabaseNonce }); + const cache = createCache({ + key: "emotion", + nonce: window.MetabaseNonce, + ...(isCypressActive && { speedy: true }), + }); // This disables :first-child not working in SSR warnings // Source: https://github.com/emotion-js/emotion/issues/1105#issuecomment-557726922 cache.compat = true;