The best way to control Claude Code, Codex and more from any computer or phone
fix(desktop): native builds prepare server bytecode again after the Effect 4.1.2 upgrade (#29780)
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
maria committed
Nov 3, 2026 at 01:43 UTC
9f6326812c2d60411687ab753bb24f2e98b67929
1 file changed
+7
-7
scripts/prepare-server-compile-cache.cjs
+7
-7
@@ -51,14 +51,14 @@ module.exports = async ({ appOutDir, electronPlatformName, arch, packager }) =>
51
env.T3CODE_HOME = state;
52
let result;
53
try {
54
- result = spawnSync(
55
- executable,
56
- [
57
- "-e",
58
- `require(${JSON.stringify(helper)}).generatePreparedServerCache(${JSON.stringify(resources)}).then(()=>process.exit(0),e=>{console.error(e);process.exit(1)})`,
59
- ],
60
- { env, encoding: "utf8", timeout: 120000 },
54
+ // Run a script file, not -e: -e defines a global __filename of "[eval]", which
55
+ // @effect/platform-node passes to createRequire and fails on.
56
+ const runner = path.join(state, "prepare-server-compile-cache-runner.cjs");
57
+ fs.writeFileSync(
58
+ runner,
59
+ `require(${JSON.stringify(helper)}).generatePreparedServerCache(${JSON.stringify(resources)}).then(()=>process.exit(0),e=>{console.error(e);process.exit(1)})`,
60
);
61
+ result = spawnSync(executable, [runner], { env, encoding: "utf8", timeout: 120000 });
62
} finally {
63
fs.rmSync(state, { recursive: true, force: true });
64
}