summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-08-15 18:59:21 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-08-15 18:59:21 +0900
commit1777cdbf812959e39a2b2abc142afc2fe8932938 (patch)
treee6384bd99bb1fa1118ae8b1a6c0332416f540803
parent59a9f4984c3acd29bc746a78e30849f50fa555ee (diff)
Fix build: move worker.server import into root loader
Top-level import in root.tsx pulled the server-only worker module into the client bundle. React Router only strips server code reached via loader/action, so start the worker from root's loader instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-rw-r--r--app/root.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/root.tsx b/app/root.tsx
index a60527e..6c60350 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -10,7 +10,11 @@ import {
import type { Route } from "./+types/root";
import "./app.css";
-import "./lib/worker.server";
+
+export async function loader() {
+ await import("./lib/worker.server");
+ return null;
+}
export const links: Route.LinksFunction = () => [
{ rel: "preconnect", href: "https://fonts.googleapis.com" },