Ionic Cordova Windows phone 10 : Build errors on polyfill.js and empty consoles

ionic info :

cli packages: (C:\Users\admin\AppData\Roaming\nvm\v9.5.0\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 windows 5.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v9.5.0
    npm               : 5.6.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\admin\AppData\Local\Android\sdk

Misc:

    backend : pro

cordova requirements :

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25
Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle

Requirements check results for windows:
Windows OS: installed Windows 10
MSBuild Tools: installed 14.0
Visual Studio: installed 14.0
Windows SDK: installed 10.0
Windows Phone SDK: installed 10.0

The project I am using is the tabs sample, here are the steps to reproduce this env :

  • ionic start tabs tabs --cordova
  • cd tabs\
  • ionic cordova platform add android
  • ionic cordova run android --device --livereload

At this point, everything runs smoothly.
Now if I try to set this up for windows 10, this is where it gets complicated, here is the only doc I found :
https://cordova.apache.org/docs/en/6.x/guide/platforms/win8/index.html
Next steps :

  • adding <preference name=“windows-target-version” value=“10.0”/ in config.xml
  • ionic cordova platform add windows

So now I have the CordovaApp.sln, the ‘solution’
I open it in VS 2017 and build with Debug ARM, and it seems that :

  • The tab app is running
  • there is no Javascript console
  • DOM Explorator is empty
  • Only output has logs, and it shows many errors with polyfill.js
'WWAHost.exe' (Script) : Chargé 'Script Code (MSAppHost/3.0)'. 
Exception was thrown at line 1, column 7917 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a139e - JavaScript runtime error: 2
Exception was thrown at line 1, column 8843 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference
Exception was thrown at line 1, column 9341 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1396 - JavaScript runtime error: Array.prototype.sort: argument is not a JavaScript object
Exception was thrown at line 1, column 8843 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.sort: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.forEach: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.map: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.filter: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.some: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.every: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.reduce: 'this' is null or undefined
Exception was thrown at line 1, column 8815 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.reduceRight: 'this' is null or undefined
Exception was thrown at line 1, column 8843 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.indexOf: 'this' is null or undefined
Exception was thrown at line 1, column 8843 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a138f - JavaScript runtime error: Array.prototype.lastIndexOf: 'this' is null or undefined
Exception was thrown at line 1, column 13496 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1389 - JavaScript runtime error: Number expected
Exception was thrown at line 1, column 26213 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1389 - JavaScript runtime error: Number.prototype.toPrecision: 'this' is not a Number object
Exception was thrown at line 2, column 3710 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1398 - JavaScript runtime error: RegExp.prototype.toString: 'this' is not a RegExp object
Exception was thrown at line 2, column 6756 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.endsWith: first argument cannot be a RegExp
Exception was thrown at line 2, column 6781 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.endsWith: first argument cannot be a RegExp
Exception was thrown at line 2, column 6756 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.includes: first argument cannot be a RegExp
Exception was thrown at line 2, column 6781 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.includes: first argument cannot be a RegExp
Exception was thrown at line 2, column 6756 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.startsWith: first argument cannot be a RegExp
Exception was thrown at line 2, column 6781 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1608 - JavaScript runtime error: String.prototype.startsWith: first argument cannot be a RegExp
Exception was thrown at line 2, column 10675 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: ArrayBuffer: cannot be called without the new keyword
Exception was thrown at line 2, column 10697 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13a5 - JavaScript runtime error: Array length must be a finite positive integer
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
Exception was thrown at line 2, column 18479 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a1600 - JavaScript runtime error: [TypedArray]: cannot be called without the new keyword
Exception was thrown at line 2, column 18500 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13dc - JavaScript runtime error: Invalid offset/length when creating typed array
Exception was thrown at line 2, column 18527 in ms-appx-web://io.ionic.starter/www/build/polyfills.js
0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
'WWAHost.exe' (Script) : Chargé 'ms-appx-web://io.ionic.starter/www/build/vendor.js'. 
'WWAHost.exe' (Script) : Chargé 'ms-appx-web://io.ionic.starter/www/build/main.js'. 

What I want is to have something to debug on windows, because if I have plugins incompatibility on my other app (which is obviously more complexe than tabs), I want to have a way to see it.

Questions :

  • Is there a way to get the Javascript Console and the DOM Explorator to work ?
  • Why polyfill.js has that much errors ? Did I miss something in some other docs ?
  • Is there an other to debug on windows 10 phone ?

Turns out I just needed to use VC 2015, the errors on the polyfill are still here tho

There is a newer cordova-windows 6.0.0 that also support VS17.

1 Like

Hey @Sujan12 thanks for the reply, I’ve updated the platform but the js logs and the DOM explorator are still empty

I’ve opt for VS 2015, for now. I’m not going to ask you to reproduce the steps, but because I’ve seen your name in other Win10 related posts, do you know how to debug a windows 10 app ?

From what I’ve seen so far, it’s supposed to be via VS. Do you know any VS dev kits, articles or maybe docs that I might have missed ?
Or is it normal that there is a somewhat ‘lack’ of information on the matter (or the way I’m doing it ) ?

Unfortunately I have no idea - I just jumped in because I saw it was broken and needed to be fixed, but have no other experience myself :confused: That said: Good luck :wink: Keep us updated here.

From what I’ve seen so far there is two way of doing it :

  • Start the project with the ionic cordova cli, and debug android, ios (with Xcode) (and windows normally) with livereload
  • Start the project with Visual Studio and add the Ionic Cordova plugins (it is said that from there you can build the 3 from VS only)

I don’t know if with the latter, there are still errors on the polyfill.js, but right now in my context (if wandering devs read this post) : You can debug an ionic cordova app via VS 2015, but with the polyfill.js errors on output (also I may have to warn you that the VS project seems to break quite easily if you modify any files)

Hello,
I am having the same issues with an app develop with ionic, I’ve followed the basic instructions for building the app on windows:
ionic cordova platform add windows
ionic cordova build windows
then open the .sln with VS2015.

There are 3 apps created, CordovaApp.Phone (Windows Phone 8.1), CordovaApp.Windows (Windows 8.1), CordovaApp.Windows10 (Universal Windows).
In VS2017 the w10 app runs without issues on emulator whilst the 8.1 apps are disabled. However the long output error on polyfills appears but once the app is started, it runs smoothly.
In VS2015 none of the phone app works. I get the ouput log with many errors on polyfills.js

I can’t find a way to get it to work, did you manage to solve your issues or do you have any solutions for this problem ?
Thanks!

Hello,
I never managed to make it work on Windows 8.1
My superior told me to give up after I told him I’d need a week of research
I had issues with sqlite, there are 2 versions or something and jumping between VS2015 and VS2017 was just a nightmare

Make sure you have the Win 8.1 SDK, even that one is hard to get
Some versions of VS2015 don’t have it, because 8.1 is no longer supported
It must be the same story with the windows cordova platform
Maybe there is a version that works for 8.1 somewhere, because I think the new ones just aims for win10

Good luck, if you managed to get it to work I’d love to have an update on this thread