From 9117b59e8ebb1c38bcd3de7fcd96b84a04b2a62b Mon Sep 17 00:00:00 2001 From: Antti Date: Sat, 17 Jan 2026 14:04:46 +0200 Subject: [PATCH] fix(frontend): resolve require is not defined error in terminal handler (#1243) Replace CommonJS require() with ES module import for child_process exec function. The require() call failed because the file uses ES module syntax. Closes #1221 Signed-off-by: Antti Co-authored-by: Claude Opus 4.5 Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com> --- apps/frontend/src/main/ipc-handlers/claude-code-handlers.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/frontend/src/main/ipc-handlers/claude-code-handlers.ts b/apps/frontend/src/main/ipc-handlers/claude-code-handlers.ts index e257bd63..81013500 100644 --- a/apps/frontend/src/main/ipc-handlers/claude-code-handlers.ts +++ b/apps/frontend/src/main/ipc-handlers/claude-code-handlers.ts @@ -8,7 +8,7 @@ */ import { ipcMain } from 'electron'; -import { execFileSync, spawn, execFile } from 'child_process'; +import { exec, execFileSync, spawn, execFile } from 'child_process'; import { existsSync, promises as fsPromises } from 'fs'; import path from 'path'; import os from 'os'; @@ -502,8 +502,6 @@ export async function openTerminalWithCommand(command: string): Promise { // For Windows, use exec with a properly formed command string // This is more reliable than spawn for complex PowerShell commands with pipes - const { exec } = require('child_process'); - const runWindowsCommand = (cmdString: string): Promise => { return new Promise((resolve) => { console.log(`[Claude Code] Executing: ${cmdString}`);