Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Actually fix emotion cache bullshittery this time
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent ef0915d commit f89ded9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion app/createEmotionCache.ts
Expand Up @@ -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" });
}
4 changes: 2 additions & 2 deletions app/root.tsx
Expand Up @@ -158,8 +158,8 @@ function getMarkup(
<meta name="dsn" content={loaderData.dsn} />
) : null}
<meta name="theme-color" content="#00a8f8" />
{helmet.meta?.toString()}
{helmet.title?.toString() ?? <title>Car Crushers</title>}
{helmet?.meta?.toString()}
{helmet?.title?.toString() ?? <title>Car Crushers</title>}
</head>
<body>{body}</body>
</html>
Expand Down
4 changes: 2 additions & 2 deletions server.ts
@@ -1,6 +1,6 @@
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
// @ts-ignore
import build from "@remix-run/dev/server-build.";
// @ts-expect-error
import * as build from "@remix-run/dev/server-build";

const handleRequest = createPagesFunctionHandler({
build,
Expand Down

0 comments on commit f89ded9

Please sign in to comment.