I am trying to deploy an existing JET application to Windows phone 10 but I run into some errors.
The application was first made in JET v2.0.2 for the Android platform, it is currently in production at the client.
The client now wants ios and windows phone versions, so the application got migrated to JET 2.2.0 by following this guide.
After migrating the Android version still works like it is supposed to.
I went through the following steps to work on the windows phone version:
- First I added the windows platform with cordova
cordova add platform windows
- I changed the windows target version (guide)
<preference name="windows-target-version" value="10.0" />
-
I installed visual studio 2015 and all the needed components by following the cordova guide
-
I open the generated solution (.sln) file with visual studio 2015

- I change the startup project to the Windows 10 universal app and change the run target to a windows phone 10 emulator

- When running the application it gets deployed to the emulator, but as soon as it runs crashes with the following error message

Unhandled exception at line 1533, column 13 in ms-appx-web://workspace/www/cordova.js
0x800a1391 - JavaScript runtime error: 'WinJS' is undefined
I found this stackoverflow post which handles the same problem, like suggested I checked my index.html to see if the WinJS library is referenced before cordova.js which is the case.
<script type="text/javascript" src="/www/WinJS/js/base.js"></script>
<script src="cordova.js"></script>
When looking at the project structure I noticed that index.html is in the "www" folder.

index.html references to the WinJS file like "/www/WinJS/js/base.js" so I tried referencing without the /www/ prefix. After changing the reference link I get a new error

Unhandled exception at line 7, column 175 in ms-appx-web://psa.mpet.containerapp/www/js/libs/require/require.js
0x800a139e - JavaScript runtime error: Mismatched anonymous define() module: function (WinJS) {
It is unclear to me why I am getting this error and how I can solve it.
Thanks in advance for your help.