[AC-288] Employee Directory sample app will not run in Windows
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2015-08-20T17:48:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | Windows |
Reporter | Mitch Starnes |
Assignee | Christopher Williams |
Created | 2015-08-05T18:05:20.000+0000 |
Updated | 2015-08-28T13:51:12.000+0000 |
Description
At run time, I get this error message:
Application Error
Error while require(./app) Variable not found: _
Attachments
File | Date | Size |
---|---|---|
AC-288-console.rtf | 2015-08-08T18:19:45.000+0000 | 304853 |
[~mitch.starnes@bnsf.com] can you please attach a test case and steps to reproduce the issue? Thanks
Start Appcelerator Studio on Windows. Wait for the Dashboard to load. Download the Employee Directory sample project and build it. Then try to run it in any of the Visual Studio 2013 Win Phone 8.1 Emulators. You should get a big red Application Error window that reads: Application Error Error while require(./app) Variable not found: _
I cloned this then built and ran it in a Windows Phone emulator to produce the error: https://github.com/appcelerator-se/corporate-directory. Error while require(./app) Variable not found: _
Console output is attached.
Resources/windows/app.js contains the following: 1: var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone; 2: 3: Alloy.createController("index");
[~mitch.starnes@bnsf.com] as today, the Employee Directory sample app has not been ported to run on Windows phones
In the github, the project tiapp.xml has the Windows platform box checked and I see platform=windows in some of the tss files. Some of the comments in GitHub say adding support for Windows. Are you sure it's not supposed to be supported?
Hey [~mstarnes] - We're going to look into this. We definitely made some updates so it should be working with Windows. We'll see if something changed internally that would break it. Thanks!
Awesome, Bert! Can't wait to see this app rock Windows! How far out is UWP (Windows 10)? :)
There were bugs in Windows SDK with how it handled app.js versus other platforms. Ultimately it meant that Alloy.Globals and things like _ weren't available in other JS file in the project unless you explicitly require()'d them. A fix has been pushed to master branch of Windows SDK and is slated for the 5.0.0 GA release. If you'd like to test the fix, you can try an SDK build off master:
Then you'll need to update the app's tiapp.xml to set the SDK version to the newly installed 5.0.0.x build.