{"record":{"id":"21d6249c4bcbfc5f","repo":"stablyai/orca","slug":"unsupported-packaged-node-pty-windows-architecture","errorCode":null,"errorMessage":"Unsupported packaged node-pty Windows architecture: ${architecture}","messagePattern":"Unsupported packaged node-pty Windows architecture: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/packaged-runtime-node-modules.cjs","lineNumber":259,"sourceCode":"      if (!existsSync(join(resourcesDir, 'node_modules', ...packageName.split('/')))) {\n        missing.add(packageName)\n      }\n    }\n  }\n\n  if (missing.size > 0) {\n    throw new Error(\n      `Packaged main bundle has bare runtime imports without copied node_modules: ${[\n        ...missing\n      ].join(', ')}`\n    )\n  }\n}\n\nfunction normalizeNodePtyWindowsArch(electronArch) {\n  const architecture = normalizeElectronArchitecture(electronArch)\n  if (architecture !== 'x64' && architecture !== 'arm64') {\n    throw new Error(`Unsupported packaged node-pty Windows architecture: ${architecture}`)\n  }\n  return architecture\n}\n\nfunction normalizeElectronArchitecture(electronArch) {\n  const architecture =\n    typeof electronArch === 'number'\n      ? ELECTRON_ARCHITECTURE_BY_ENUM[electronArch]\n      : electronArch === 'armv7l'\n        ? 'arm'\n        : electronArch\n  if (!PACKAGED_NATIVE_ARCHITECTURES.has(architecture)) {\n    throw new Error(`Unsupported packaged runtime architecture: ${String(electronArch)}`)\n  }\n  return architecture\n}\n\nfunction pruneNodePtyNativeDirectories(directory, platformPrefix, electronArch, allowsSuffix) {","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/packaged-runtime-node-modules.cjs#L241-L277","documentation":"The `normalizeNodePtyWindowsArch` function calls `normalizeElectronArchitecture` to convert the arch enum/string to a normalized name, then rejects anything other than 'x64' or 'arm64'. This is called only during Windows packaging (`ensurePackagedNodePtyConptyRuntime` at line 328) to locate the correct ConPTY payload directory (`win10-x64` or `win10-arm64`). node-pty's ConPTY runtime files are only built for these two architectures.","triggerScenarios":"Packaging node-pty for Windows with an architecture that normalizes to 'ia32' or 'arm' — e.g., context.arch === 0 (ia32) or 2 (armv7l). Passing a string arch like 'ia32' or 'arm' to the packaging step. This is narrower than the general arch check (error [19]) because ConPTY only ships for x64/arm64.","commonSituations":"Adding ia32 or arm to the Windows build target architecture list. A future Electron version adding new arch enum values. Cross-compiling for a Windows architecture that node-pty doesn't support.","solutions":["Check the Windows build target architecture in electron-builder config — it should only be 'x64' and/or 'arm64'.","If you need ia32 or arm Windows builds, node-pty's ConPTY payload doesn't ship for those — you'd need to build node-pty from source for that arch or skip ConPTY.","Log `electronArch` at the call site (prunePackagedNodePty → ensurePackagedNodePtyConptyRuntime) to see what value is being passed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify Windows arch is supported for node-pty ConPTY before packaging\nfunction assertNodePtyWindowsArch(archEnum) {\n  const map = { 0: 'ia32', 1: 'x64', 2: 'arm', 3: 'arm64' }\n  const arch = map[archEnum]\n  if (arch !== 'x64' && arch !== 'arm64') {\n    throw new Error(`node-pty ConPTY only supports x64/arm64 on Windows, got: ${arch}`)\n  }\n}","typeGuard":"function isSupportedNodePtyWindowsArch(arch: string): arch is 'x64' | 'arm64' {\n  return arch === 'x64' || arch === 'arm64'\n}","tryCatchPattern":null,"preventionTips":["Only target x64 and arm64 for Windows builds.","Don't add ia32 or arm to the Windows target arch list.","Check node-pty's ConPTY availability before adding new Windows arch targets."],"tags":["packaging","windows","node-pty","architecture","native-modules","conpty"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}