[ALOY-1738] CLI 8.1.0: crash when to listening backbone.events on required controller in ScrollableView

GitHub Issuen/a
Resolution Date2020-09-14T18:27:05.000+0000
Affected Version/sCLI Release 8.1.0, Alloy 1.15.1
Fix Version/sCLI Release 8.1.1
ReporterTeun Klijn
AssigneeEwan Harris


When you add a backbone event listener to a required controller that's nested in a ScrollableView the app will crash. This was working with CLI 8.0.0 and still works correctly with 8.1.0 when the require isn't nested in a ScrollableView. *To reproduce* Run the example below with CLI 8.1.0. +index.js+
function doSomething(e) {
  console.log('do something!');

  <Window class="container">
      <Require id="label" src="label" onNotify="doSomething" />
var args = $.args;

function passClick(e) {
  <Label id="label" onClick="passClick">Hello, World</Label>
*Expected behavior* The app will run without crashing and the event is handled correctly. *Actual behavior* The app crashes with the following crash message:
"$.__views[\"label\"].on is not a function. (In '$.__views[\"label\"].on('notify', doSomething)', '$.__views[\"label\"].on' is undefined)";


  1. Ewan Harris 2020-08-28 [~teunklijn@telfort.nl] thanks for the comprehensive issue, I'll move this over to the ALOY project
  2. Ewan Harris 2020-08-28 PR: https://github.com/appcelerator/alloy/pull/967 [~teunklijn@telfort.nl], if you wanted to try and patch your CLI locally you can do the following: 1. Open up the appc CLI directory in explorer/finder * Windows: C:\Users\\.appcelerator\install\8.1.0\package\ * MacOS: ~/.appcelerator/install/8.1.0/package/ 2. Open node_modules/alloy/Alloy/commands/compile/parsers/Alloy.Require.js 3. Apply the changes in the above PR
  3. Ewan Harris 2020-08-28 Notes for testing, verify the test case from ALOY-1256 still works, as well as https://github.com/ewanharris/ALOY-1256-test, the test case from this ticket and maybe try the PKO/Community apps as they use the Require tag Edit: Also check out the following widgets test apps [nl.fokkezb.infiniteScroll](https://github.com/Topener/nl.fokkezb.infiniteScroll/tree/test) and [nl.fokkezb.pullToRefresh](https://github.com/Topener/nl.fokkezb.pullToRefresh/tree/test)
  4. Teun Klijn 2020-08-28 Thanks! This does fix my issue.
  5. Lokesh Choudhary 2020-09-14 Verified the fix with 8.1.1-master.8. Closing.

JSON Source