Actually fix emotion cache bullshittery this time

This commit is contained in:
2023-10-19 16:49:10 -04:00
parent ef0915df4f
commit f89ded9ae8
3 changed files with 10 additions and 5 deletions

View File

@ -3,5 +3,10 @@ import createCache from "@emotion/cache";
export const defaultCache = createEmotionCache();
export default function createEmotionCache() {
return createCache.default({ key: "cha" });
// @ts-expect-error
// 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" })
: createCache({ key: "cha" });
}