我正在尝试运行bishop fox的unredactor。对于我的生活来说,我不能编译代码。我把它放在VScode中调试,因为我不知道typescript或js(只有基本的HTML)我不能说出哪里出了问题。VS代码说有两个错误,我发布了其中的截图。在网上找不到任何关于这个问题或解决方案的相关信息。我希望有人能给我指出如何解决这个问题的方向,因为我已经试着运行这个程序几个星期了。谢谢。
VS代码调试1
"message": "Type '{ preload: string; nodeIntegration: false; worldSafeExecuteJavaScript: true; contextIsolation: true; }' is not assignable to type 'WebPreferences'.\n Object literal may only specify known properties, and 'worldSafeExecuteJavaScript' does not exist in type 'WebPreferences'.",
"source": "ts",
"startLineNumber": 20,
"startColumn": 7,
"endLineNumber": 20,
"endColumn": 39,
"relatedInformation": [
{
"startLineNumber": 13642,
"startColumn": 5,
"endLineNumber": 13642,
"endColumn": 19,
"message": "The expected type comes from property 'webPreferences' which is declared here on type 'BrowserWindowConstructorOptions'",
VS代码调试2
"message": "Type '{ sandbox: true; webSecurity: true; contextIsolation: true; webviewTag: false; enableRemoteModule: false; allowRunningInsecureContent: false; nodeIntegration: false; nodeIntegrationInWorker: false; nodeIntegrationInSubFrames: false; nativeWindowOpen: false; safeDialogs: true; }' is not assignable to type 'WebPreferences'.\n Object literal may only specify known properties, and 'enableRemoteModule' does not exist in type 'WebPreferences'.",
"source": "ts",
"startLineNumber": 177,
"startColumn": 7,
"endLineNumber": 177,
"endColumn": 32,
"relatedInformation": [
{
"startLineNumber": 13642,
"startColumn": 5,
"endLineNumber": 13642,
"endColumn": 19,
"message": "The expected type comes from property 'webPreferences' which is declared here on type 'BrowserWindowConstructorOptions'",
1条答案
按热度按时间1qczuiv01#
您看到的问题与Electron有关。
您使用的一定是旧代码段。属性
worldSafeExecuteJavaScript
已从较新版本的Electron中删除;它现在总是启用的。enableRemoteModule
也是如此。远程功能从核心库中提取到一个单独的包中。电子14 dropped the type definition对此属性进行了设置,但其内部默认值为false。可以安全地从代码中移除这两个属性。