Actually fix emotion cache bullshittery this time

This commit is contained in:
regalijan 2023-10-19 16:49:10 -04:00
parent ef0915df4f
commit f89ded9ae8
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520
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 const defaultCache = createEmotionCache();
export default function 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" });
} }

View File

@ -158,8 +158,8 @@ function getMarkup(
<meta name="dsn" content={loaderData.dsn} /> <meta name="dsn" content={loaderData.dsn} />
) : null} ) : null}
<meta name="theme-color" content="#00a8f8" /> <meta name="theme-color" content="#00a8f8" />
{helmet.meta?.toString()} {helmet?.meta?.toString()}
{helmet.title?.toString() ?? <title>Car Crushers</title>} {helmet?.title?.toString() ?? <title>Car Crushers</title>}
</head> </head>
<body>{body}</body> <body>{body}</body>
</html> </html>

View File

@ -1,6 +1,6 @@
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages"; import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
// @ts-ignore // @ts-expect-error
import build from "@remix-run/dev/server-build."; import * as build from "@remix-run/dev/server-build";
const handleRequest = createPagesFunctionHandler({ const handleRequest = createPagesFunctionHandler({
build, build,