首页 > 解决方案 > Nativescript angular WebView - “无法为 devtools 启动 http 服务器”

问题描述

我正在尝试让 WebView 为我们的 Angular Nativescript 应用程序工作。不幸的是,尝试在连接到 Internet ( ) 的模拟器中加载 webview 时出现以下错误,出现空白屏幕tns run android --bundle

JS: WebView<plaid-webview> chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0 02-26 14:52:07.826 12754 12754 I cr_BrowserStartup: Initializing chromium process, singleProcess=false chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.

这是组件html:

<StackLayout>
    <WebView #plaidWebview id="plaid-webview" [src]="plaidWebviewSrc"> 
    </WebView>
</StackLayout>

在组件 ts (component.tns.ts) 中,我设置了 src:

@Component({
  selector: 'plaid-webview',
  templateUrl: './plaid-webview.component.html',
  styleUrls: ['./plaid-webview.component.scss']
})
export class PlaidWebViewComponent implements OnInit {

public plaidWebViewSrc : string = "https://docs.nativescript.org/";
...

这与此处的文档相匹配

标签: angularnativescriptangular2-nativescript

解决方案


我不确定我之前做错了什么,但 webview 现在正在正确加载 url。我仍然收到 devtools 错误,但我并不过分担心它。如果有人对此有解决方案,请随时发布,我会标记为解决方案。


推荐阅读