import createCache from "@emotion/cache"; export default function createEmotionCache(nonce?: string) { // The browser throws when calling .default, but the server throws if we don't call .default // Of course! return typeof document === "undefined" ? createCache.default({ key: "cha", nonce }) : // @ts-expect-error createCache({ key: "cha", nonce }); }