Extension fails to activate in Trae: "command 'deepsec.openReport' not found"
环境
- 扩展版本: 0.2.0
- IDE: Trae CN(基于 VS Code)
- 操作系统: Windows
- deepsec CLI: 可正常运行(
deepsec report --help 正常)
问题描述
扩展激活失败,所有 deepsec.* 命令(如 deepsec.openReport)都报
"command 'deepsec.openReport' not found"。
错误日志 (exthost.log)
[error] Activating extension unclecheng.deepsec-security failed due to an error:
[error] TypeError: 'get' on proxy: property 'get' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '...' but got '(section, defaultValue) => {...}')
at createFindingStore (extension.js:21336:23)
at activate (extension.js:20016:18)
根因分析
configuration() 函数用 new Proxy() 包裹 vscode.workspace.getConfiguration("deepsec")
返回的配置对象,并拦截 get 属性返回自定义函数。但 VS Code/Trae 的配置对象本身是
Proxy,且 get 属性是只读且不可配置的。外层 Proxy 替换 get 属性违反了该约束,
导致 createFindingStore() 调用 configuration().get("storeFindings", true) 时抛
TypeError,activate() 中断,命令未注册。
Extension fails to activate in Trae: "command 'deepsec.openReport' not found"
环境
deepsec report --help正常)问题描述
扩展激活失败,所有
deepsec.*命令(如deepsec.openReport)都报"command 'deepsec.openReport' not found"。
错误日志 (exthost.log)
根因分析
configuration()函数用new Proxy()包裹vscode.workspace.getConfiguration("deepsec")返回的配置对象,并拦截
get属性返回自定义函数。但 VS Code/Trae 的配置对象本身是Proxy,且
get属性是只读且不可配置的。外层 Proxy 替换get属性违反了该约束,导致
createFindingStore()调用configuration().get("storeFindings", true)时抛TypeError,activate()中断,命令未注册。