From 1777cdbf812959e39a2b2abc142afc2fe8932938 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sat, 15 Aug 2026 18:59:21 +0900 Subject: 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 --- app/root.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') 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" }, -- cgit v1.2.3