Titanium JIRA Archive
Alloy (ALOY)

[ALOY-363] MobileWeb: Default Project: fails with Uncaught TypeError: Cannot use 'in' operator to search for 'click' in undefined index.html:5219

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2012-11-30T19:03:40.000+0000
Affected Version/sAlloy 0.3.1
Fix Version/sn/a
ComponentsSamples & Templates
Labelsn/a
ReporterDustin Hyde
AssigneeTony Lukasavage
Created2012-11-02T22:25:41.000+0000
Updated2014-06-22T13:23:15.000+0000

Description

Running the default alloy project in mobileweb fails with runtime error:
Uncaught TypeError: Cannot use 'in' operator to search for 'click' in undefined index.html:5219
Steps to Reproduce: 1. Create Default Alloy Project. 2. Run project in MobileWeb. Actual Result: Runtime Error. Expected Result: 'Hello, World!'

Comments

  1. Tony Lukasavage 2012-11-02

    This happens as a result of the fact that Mobileweb does not support compiler plugins in the pre-3.0.0 CLI. Because it does not support compiler plugins, alloy's compile process does not run and that vague error is the end result of an uncompiled app attempting to run for mobileweb. The only way now to successfully compile and run an alloy app for mobileweb through TiStudio is to first compile the application from the command line, then run it in TiStudio.
       alloy compile --config platform=mobileweb
       
    In the long term, once TiSDK 3.0.0 is the minimum version supported by Alloy, this can be totally avoided as the new CLI in 3.0.0 will support compiler plugins (now called "hooks") for mobileweb. If you test against the new CLI now this should be the case, as it was when I tested last week. I have linked ALOY-323 to this ticket. As you can see, there's a lot of further Alloy advancements that hinge on the official release of 3.0.0.
  2. Dustin Hyde 2012-11-02

    I was able to run the two-tab template for some reason in mobileweb.
  3. Tony Lukasavage 2012-11-02

    Chances are that you recently built the two tabbed template for another platform, and the two tabbed template has nothing specific to that platform at compile time. In essence it will "work", but it is not actually compiled for mobileweb.
  4. Tony Lukasavage 2012-11-30

    This is a bug with the old CLI as it relates to Mobileweb's lack of implementation of compiler plugins. The new CLI, available in Titanium 3.0+, will work as expected making this issue irrelevant when 3.0 is officially released. In the meantime, those still using Titanium < 3.0 will just need to do a
       alloy compile --config platform=mobileweb 
       
    before attempting to run alloy mobileweb apps in tistudio
  5. Dustin Hyde 2013-05-01

    Closing.

JSON Source