microsoft / cordova-plugin-ms-appinsights

Cordova plugin for App Insights
Other
21 stars 31 forks source link

SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4 #10

Open drpicox opened 8 years ago

drpicox commented 8 years ago

This problem only affects to WindowsPhone 8.1 platform (not tested in other Windows platforms) it does not happen (works like a charm) in iOS or Android. We also have detected that Windows Phone browser detects https://dc.services.visualstudio.com SSL certificate as invalid.

Steps followed to create a new app:

> git clone https://github.com/MSOpenTech/cordova-plugin-appinsights.git
> cordova create TAI
> cd TAI
> cordova platform add windows
> cordova plugin add ../cordova-plugin-appinsights --variable INSTRUMENTATION_KEY=%YOUR_KEY%
> cordova plugin add cordova-plugin-battery-status cordova-plugin-network-information
> cordova build windows
> start platforms/windows/CordovaApp.sln

Now select CordovaApp.Phone as startup project, debug on device, and in the Javascript console write:

appInsights.trackEvent('TAI');
appInsights.flush();

The result of both commands should be undefined and the event must be added to the events list.

If you do cordova platform remove windows and cordova platform add windows it still working well.

How to reproduce the problem

From the previows installation just add a plugin (it seems that does not matter which, almost with any plugins the problem appears):

> cordova plugin add cordova-plugin-camera
> cordova build windows
> start platforms/windows/CordovaApp.sln

Make sure that you have selected CordovaApp.Phone as startup project. Start debug on device, and in the Javascript console write:

appInsights.trackEvent('TAI-with-camera');
appInsights.flush();

The result is:

undefined
SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4
File: index.html
Failed to send telemetry:

And no event is shown is shown in the appInsights portal.

But, if we now do on the same project:

> cordova plugin remove cordova-plugin-camera
> cordova build windows
> start platforms/windows/CordovaApp.sln

Make sure that you have selected CordovaApp.Phone as startup project. Start debug on device, and in the Javascript console write:

appInsights.trackEvent('TAI-without-camera');
appInsights.flush();

The result stills the same:

undefined
SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4
File: index.html
Failed to send telemetry:

If I do

> cordova remove platform windows
> cordova add platform windows
> cordova build windows
> start platforms/windows/CordovaApp.sln

and repeat test, problem still appearing.

Note: I'm using VS Express 2013 for Windows 12.0.30723.00 Update 3, and Windows 8.1 Pro 6.3.9600, tested on few devices (Nokia Lumia 925 RM-892 & MS Lumia 640 XL Dual SIM)

vkana commented 7 years ago

Hi, I'm seeing similar error on IE10 on windows 7. Happens only for the first time. It works fine when I retry.

it's a GET call and happening from inside an iFrame.

SCRIPT7002: XMLHttpRequest: Network Error 0x2ee4, Could not complete the operation due to error 00002ee4.

Any solution?