I'm trying to migrate a Win/WinPhone 8.1 app to a Win10 (UWP) package.
So far the app is building fine and running, but crashes on first reference on Windows component:
Windows is undefined
(e.g. on accessing Windows.Storage.ApplicationData.current)
Some facts:
- WinJS (base.js) is loaded before cordova.js
- WinJS is available in global namespace - Windows is not
- UseDotNetNativeToolchain property is set to true on *.jsproj
- using Cordova Windows v.4.4.3 / WinJS 4.4.0
On Try-And-Error I also added some references like Windows Mobile Extensions for the UWP or Microsoft .NET Native Runtime Package for Windows , but that wasn't the reason.
Any ideas what is missing?
window, notwindows. Maybe you can provide SO Snippet with issue? - Justinaswindowis the global object. But I really meanWindowsfrom the Windows API. Example would beWindows.Storage.ApplicationData.current.localSettings.values["Key"] = "Value";see docs.microsoft.com/en-us/uwp/api/… and choose JavaScript on the right - kerosenevar hasWinRT = !!_Global.Windows;is false on base.js - kerosene