{"record":{"id":"87249c7b810e7f1f","repo":"docmirror/dev-sidecar","slug":"error","errorCode":null,"errorMessage":"不支持此操作","messagePattern":"不支持此操作","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/shell/scripts/enable-loopback.js","lineNumber":36,"sourceCode":"      sudoPrompt.exec(\n        sudoCommand.join(' '),\n        options,\n        (error, _, stderr) => {\n          if (stderr) {\n            log.error(`[sudo-prompt] 发生错误: ${stderr}`)\n          }\n\n          if (error) {\n            reject(error)\n          } else {\n            resolve(undefined)\n          }\n        },\n      )\n    })\n  },\n  async linux (exec, { port }) {\n    throw new Error('不支持此操作')\n  },\n  async mac (exec, { port }) {\n    throw new Error('不支持此操作')\n  },\n}\n\nmodule.exports = async function (args) {\n  return execute(executor, args)\n}\n","sourceCodeStart":18,"sourceCodeEnd":46,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/core/src/shell/scripts/enable-loopback.js#L18-L46","documentation":"The `enable-loopback` shell script implements loopback exemption only for Windows; its `linux` handler is an explicit placeholder that throws `不支持此操作` (operation not supported). Loopback unblocking is a Windows-specific network restriction workaround, so on Linux the operation is intentionally unavailable.","triggerScenarios":"Calling the enable-loopback shell API (`DevSidecar.shell.enableLoopback` / scripts/enable-loopback.js) while `getPlatform()` resolves to `linux`, so dispatch lands on the `linux` stub.","commonSituations":"Running the GUI/CLI on Linux where startup or a user action tries to apply Windows-only loopback settings; cross-platform scripts copied from Windows documentation.","solutions":["Do not invoke enable-loopback on Linux — it is not needed there; guard the call behind a platform check.","If you need equivalent behavior, implement the linux handler yourself (e.g. no-op returning success) in a fork.","Update config so `systemProxy`/loopback-related settings do not trigger this script on Linux."],"exampleFix":"// before\nawait DevSidecar.shell.enableLoopback({ port })\n// after\nif (process.platform === 'win32') {\n  await DevSidecar.shell.enableLoopback({ port })\n}","handlingStrategy":"fallback","validationCode":"if (process.platform !== 'win32') {\n  console.info('enable-loopback is Windows-only; skipping')\n  return\n}","typeGuard":"function supportsLoopback () {\n  return process.platform === 'win32'\n}","tryCatchPattern":"try {\n  await DevSidecar.shell.enableLoopback({ port })\n} catch (err) {\n  if (err.message === '不支持此操作') {\n    log.info('loopback exemption not supported on this platform; ignored')\n  } else { throw err }\n}","preventionTips":["Gate Windows-only shell helpers behind platform checks","Do not enable loopback-related settings on Linux/macOS builds","Treat 不支持此操作 from shell scripts as expected platform behavior"],"tags":["platform-unsupported","linux","loopback"],"backgroundTag":"platform-not-supported","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}