stablyai/orca · error · Error
Playwright did not return a PID
Error message
Playwright did not return a PID
What it means
The harness spawns the Playwright test process (`pnpm run test:e2e:terminal-ibus-hangul-native`-style invocation) with stdio inherit and ORCA_E2E_NATIVE_IBUS_HANGUL=1. If spawn() returns no pid the test driver never launched, so awaiting testExitCode is impossible. Common when node/pnpm cannot be found or the project dir is wrong.
Source
Thrown at config/scripts/run-terminal-ibus-hangul-e2e.mjs:200
[
'run',
'test:e2e:headful',
'--workers=1',
'--',
'tests/e2e/terminal-ibus-hangul-native.spec.ts'
],
{
cwd: projectDir,
env: {
...process.env,
ORCA_E2E_FORWARD_APP_LOGS: '1',
ORCA_E2E_NATIVE_IBUS_HANGUL: '1'
},
stdio: 'inherit'
}
)
if (!testProcess.pid) {
throw new Error('Playwright did not return a PID')
}
evidence.playwrightPid = testProcess.pid
console.error(`[terminal-ime] started Playwright PID ${testProcess.pid}`)
testExitCode = await waitForExit(testProcess)
} finally {
if (ibusProcess?.pid) {
evidence.ibusGroupBeforeCleanup = processGroupMembers(ibusProcess.pid)
evidence.ibusGroupAfterCleanup = await stopOwnedProcessGroup(ibusProcess.pid)
}
if (windowManagerProcess?.pid) {
evidence.windowManagerGroupAfterCleanup = await stopOwnedProcessGroup(
windowManagerProcess.pid
)
}
closeSync(ibusLogFd)
closeSync(windowManagerLogFd)
mkdirSync(path.join(projectDir, 'test-results'), { recursive: true })
copyFileSync(View on GitHub (pinned to 1136503c6a)
Solutions
- Confirm projectDir points at the repo root where package.json and the e2e script exist.
- Ensure pnpm and node are on PATH in process.env inherited by the spawn (the session env block does not re-export PATH).
- Run the Playwright command by hand inside an xvfb session to surface the fork error.
Example fix
// before // projectDir wrong or pnpm missing on PATH -> no pid // after // run from repo root and verify pnpm which pnpm && pnpm run test:e2e:terminal-ibus-hangul-native
Defensive patterns
Strategy: validation
Validate before calling
const { spawnSync } = require('node:child_process')
if (spawnSync('which', ['pnpm']).status !== 0 || !existsSync(projectDir + '/package.json')) {
console.error('pnpm missing or projectDir invalid'); process.exit(1)
} Type guard
function hasPid(child: { pid?: number }): child is { pid: number } {
return typeof child.pid === 'number'
} Try / catch
const testProc = spawn(cmd, args, { cwd: projectDir, env, stdio: 'inherit' })
testProc.once('error', (e) => { console.error('playwright spawn failed:', e.message) })
if (!testProc.pid) throw new Error('Playwright did not return a PID') Prevention
- Validate projectDir resolves to the repo root with package.json.
- Ensure pnpm/node are on PATH in the inherited env.
- Attach an 'error' listener to spawn to capture ENOENT with context.
When it happens
Trigger: The spawn of the Playwright runner fails to fork — wrong cwd (projectDir), missing node/pnpm on PATH in the inherited env, or the spawned command's binary is absent.
Common situations: projectDir resolved incorrectly (run from outside repo root); pnpm not on PATH inside the X11 session env; the test script name changed in package.json so the spawn command is invalid; node binary moved.
Related errors
- npm_execpath is required; run this harness through pnpm
- xfwm4 did not return a PID
- ibus-daemon did not return a PID
- xvfb-run did not return a PID
- [plain-node-entry-guard] could not smoke-load daemon-entry.j
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/33d590a5d67d6447.
Report an issue: GitHub.