ionic windows uwp blank screen

0

I’m trying to get my ionic 4 app to work on windows, but all I get is a blank screen.

I tried to put a console log on the beginning of my index.html and it shows up. The angular root html tag is empty so the problem is not the splashscreen staying on screen. I tried the solution everyone give with replacing <base href="/" /> with <base href="./" /> in index.html and it’s not working.

My app works fine in android and ios.

I get two error in the logs in vendor.js that I completely don’t understand.

TypeError: Unable to get property 'define' of undefined or null reference
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/vendor.js:106341:1841)
   at Array.prototype.forEach (native code)
   at t (ms-appx-web://myApp.fffffffff/www/vendor.js:106341:1821)
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/vendor.js:106341:1808)
   at ZoneDelegate.prototype.invoke (ms-appx-web://myApp.fffffffff/www/polyfills.js:2735:13)
   at onInvoke (ms-appx-web://myApp.fffffffff/www/vendor.js:65554:17)
   at ZoneDelegate.prototype.invoke (ms-appx-web://myApp.fffffffff/www/polyfills.js:2735:13)
   at Zone.prototype.run (ms-appx-web://myApp.fffffffff/www/polyfills.js:2495:17)
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/polyfills.js:3255:17)
   at ZoneDelegate.prototype.invokeTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2767:13)
main.js (13895,13)

and the second one

Unhandled Promise rejection: Unable to get property 'apply' of undefined or null reference ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Unable to get property 'apply' of undefined or null reference TypeError: Unable to get property 'apply' of undefined or null reference
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/vendor.js:105260:19)
   at ZoneDelegate.prototype.invoke (ms-appx-web://myApp.fffffffff/www/polyfills.js:2735:13)
   at Zone.prototype.run (ms-appx-web://myApp.fffffffff/www/polyfills.js:2495:17)
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/polyfills.js:3255:17)
   at ZoneDelegate.prototype.invokeTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2767:13)
   at Zone.prototype.runTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2540:21)
   at drainMicroTaskQueue (ms-appx-web://myApp.fffffffff/www/polyfills.js:2946:25)
polyfills.js (3048,17)
   "Unhandled Promise rejection:"
   "Unable to get property 'apply' of undefined or null reference"
   "; Zone:"
   "<root>"
   "; Task:"
   "Promise.then"
   "; Value:"
   {
      [functions]: ,
      __proto__: { },
      description: "Unable to get property 'apply' of undefined or null reference",
      message: "Unable to get property 'apply' of undefined or null reference",
      name: "TypeError",
      number: -2146823281,
      stack: "TypeError: Unable to get property 'apply' of undefined or null reference
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/vendor.js:105260:19)
   at ZoneDelegate.prototype.invoke (ms-appx-web://myApp.fffffffff/www/polyfills.js:2735:13)
   at Zone.prototype.run (ms-appx-web://myApp.fffffffff/www/polyfills.js:2495:17)
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/polyfills.js:3255:17)
   at ZoneDelegate.prototype.invokeTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2767:13)
   at Zone.prototype.runTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2540:21)
   at drainMicroTaskQueue (ms-appx-web://myApp.fffffffff/www/polyfills.js:2946:25)"
   }
   "TypeError: Unable to get property 'apply' of undefined or null reference
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/vendor.js:105260:19)
   at ZoneDelegate.prototype.invoke (ms-appx-web://myApp.fffffffff/www/polyfills.js:2735:13)
   at Zone.prototype.run (ms-appx-web://myApp.fffffffff/www/polyfills.js:2495:17)
   at Anonymous function (ms-appx-web://myApp.fffffffff/www/polyfills.js:3255:17)
   at ZoneDelegate.prototype.invokeTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2767:13)
   at Zone.prototype.runTask (ms-appx-web://myApp.fffffffff/www/polyfills.js:2540:21)
   at drainMicroTaskQueue (ms-appx-web://myApp.fffffffff/www/polyfills.js:2946:25)"

I don’t know if it’s these errors that cause my app to stay blank and not launching angular, still at the end of the logs I get the “Ionic Native: deviceready event fired after 4704 ms”

any ideas ?

As far as we know, UWPs were deprecated? But the errors you’re seeing are because the webview in UWP is really old edge/IE 11, which Ionic does not support.

You’re best bet is to build a PWA and take advantage of the of the PWA support windows provides