{"draft":null,"from":288,"to":289,"files":[{"path":"client/src/local-store.ts","added":12,"removed":10,"diff":"--- a/client/src/local-store.ts\n+++ b/client/src/local-store.ts\n@@ -221,24 +221,26 @@\n \t\t// copy has it already: the build points the import at the same file (scripts/build-client.mjs).\n \t\tconst standIn = new URL(\"./durable-object-stand-in.ts\", import.meta.url).href;\n \t\tconst mod = (await import(\"node:module\")) as unknown as {\n-\t\t\tregisterHooks?: (hooks: unknown) => { deregister(): void };\n+\t\t\tregisterHooks?: (hooks: unknown) => unknown;\n \t\t};\n-\t\tconst hooks = mod.registerHooks?.({\n+\t\t// The hook stays for the rest of the process: deregistering it crashes Node 24 at exit when the compile cache\n+\t\t// is on (client/avcs.ts turns it on). It answers only cloudflare:workers.\n+\t\tmod.registerHooks?.({\n \t\t\tresolve(specifier: string, context: unknown, next: (s: string, c: unknown) => unknown) {\n \t\t\t\tif (specifier === \"cloudflare:workers\") return { url: standIn, shortCircuit: true };\n \t\t\t\treturn next(specifier, context);\n \t\t\t},\n \t\t});\n+\t\tlet loaded: typeof import(\"./local-server.mjs\");\n \t\ttry {\n-\t\t\tconst { handle, ProjectObject } = await import(\"./local-server.mjs\");\n-\t\t\treturn {\n-\t\t\t\tDatabaseSync: sqlite.DatabaseSync,\n-\t\t\t\thandle,\n-\t\t\t\tProjectObject,\n-\t\t\t};\n-\t\t} finally {\n-\t\t\thooks?.deregister();\n+\t\t\tloaded = await import(\"./local-server.mjs\");\n+\t\t} catch (e) {\n+\t\t\t// Nothing is reached for here: a part of the client is missing (its packages not installed, say).\n+\t\t\tthrow new LocalError(\n+\t\t\t\t`local projects couldn't load the server's code: ${e instanceof Error ? e.message : String(e)}`,\n+\t\t\t);\n \t\t}\n+\t\treturn { DatabaseSync: sqlite.DatabaseSync, handle: loaded.handle, ProjectObject: loaded.ProjectObject };\n \t})();\n \treturn server;\n }"}],"unmatched":[]}