diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-08-15 18:59:21 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-08-15 18:59:21 +0900 |
| commit | 1777cdbf812959e39a2b2abc142afc2fe8932938 (patch) | |
| tree | e6384bd99bb1fa1118ae8b1a6c0332416f540803 /app/root.tsx | |
| parent | 59a9f4984c3acd29bc746a78e30849f50fa555ee (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>
Diffstat (limited to 'app/root.tsx')
| -rw-r--r-- | app/root.tsx | 6 |
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" }, |
