科尔多瓦在Internet Explorer或Microsoft Edge上运行浏览器失败

时间:2019-05-14 06:47:13

标签: angular internet-explorer angular6 phonegap apache-cordova

我创建了一个Cordova项目并将其与Angular 6集成,然后使用Cordova Platform Add Browser命令添加了浏览器平台,执行ng build并使用Cordova Run命令使用Cordova托管了角度输出之后,它在chrome中可以正常工作浏览器,但是对于Internet Explorer或Microsoft Edge,它无法呈现页面并在错误消息下方抛出

System.ArgumentNullException: No message was deserialized prior to calling the DispatchChannelSink.

Parameter name: requestMsg

   at System.Runtime.Remoting.Channels.DispatchChannelSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

   at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

   at System.Runtime.Remoting.MetadataServices.SdlChannelSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

   at System.Runtime.Remoting.Channels.Http.HttpServerTransportSink.ServiceRequest(Object state)

   at System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()

我们尝试在index.html中添加缺少的polyfill和shims以及meta http-equiv,如下所示。

<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.13/es5-sham.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

当我们执行cordova运行浏览器并在Internet Explorer或Microsoft Edge中启动托管的角度网站时,它的工作方式应与Chrome浏览器中的工作方式类似。

1 个答案:

答案 0 :(得分:1)

经过一天的尝试,发现默认端口8000正在使用中,因此必须更改在路径“ platforms \ browser \ cordova \”下找到的run.js。 具有以下值

WKNavigationDelegate, WKUIDelegate