Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1748] Widget - Regression - weird behavior - some exporting functions are not working with CLI 8.1.1

GitHub Issuen/a
Affected Version/sn/a
Fix Version/sn/a
Labels9.3.0.GA, Android, CLI8.1.1, Widget, exports, iOS
ReporterFrancisco Antonio Duran Ramirez
AssigneeAbir Mukherjee


Hello. Good afternoon. Basically adding a *widget* to any section, and trying to execute a *functionality* which it was *exported* from the section where it was added the widget; some of the exported functionalities are *not working* with the *CLI 8.1.1*, but if you try to use a lower version it is working pretty good, so that's mean that it is a regression. More details, please try to use the project attached. * XML
     <Widget src="KlassWindow" id="win" />
* JS
This part about $.win.showAlert(); it is working with CLI 8.0.0, but not with CLI 8.1.1. * WIDGET XML
     <Window class="container" id="win" />
var args = arguments[0] || {};

exports.open = function () {

exports.showAlert = function() {
	alert("CLI 8.0.0 WORKING!!!");
Please let me know whether you have any doubt or question. Thanks, and best, Antonio Duran.




  1. John Staunton 2021-06-15

    Exact same issue here - big issues caused due to this bug, seemingly no way to work around it
  2. John Staunton 2021-06-15

    Bug also exists in CLI 9.0.1
  3. John Staunton 2021-06-16

    A workaround (posted in the TiSlack channel) that seems to work is to change your widget slightly to export the function as: $.widget.showAlert = function() { } instead of exports.showAlert... where 'widget' is the top-level View or Window of your widget
  4. Ewan Harris 2021-06-16

    This is caused by a behaviour change we overlooked when implementing the linked ticket, if a widget is the only node in a view it will become the top level node. So $.win then becomes a reference to the window in the Widget rather than the Widget itself. Another way to workaround this is to add an empty tag of some kind to the view, so that the Widget tag isn't the only tag in the view. Off the top of my head, I'm not sure how we can maintain the correct behaviour and support ALOY-1256

JSON Source