Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27525] Commented out line with Ti.include in it causes LiveView failure

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-06-17T13:28:39.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
ComponentsLiveView
Labelsn/a
ReporterRay Belisle
AssigneeEbenezer Boateng
Created2019-10-25T13:33:15.000+0000
Updated2020-06-17T13:28:39.000+0000

Description

On any project, add the following line:
//Ti.include('vendor/pubnub.js');
Make sure the line is *COMMENTED OUT* with the single line prefix *//*. Compile the app with LiveView turned on. The file load will fail. Remove the line and save, the file will load without issue. It seems that somehow, LiveView is ignoring the fact the line is commented out and trying to process the 'include' function, causing the error. If you surround by a multi line comment like this instead, then it works.
/*Ti.include('vendor/pubnub.js');*/

Comments

  1. Ewan Harris 2019-11-04

    This looks to be some bad code in liveview where it tries to handle Ti.include calls but doesn't ignore commented out code causing the try/catch it's wrapped it to get borked (the multi-line comment is self contained so that's why it doesn't break) anything. Moving to TIMOB, thanks for the report [~raybelisle]
  2. Ebenezer Boateng 2020-02-25

    https://github.com/appcelerator/liveview/pull/134
  3. Ewan Harris 2020-03-09

    Removing from current sprint as this will only be testable once we update liveview in the SDK, when we do that we can pull this ticket back into the sprint for qe
  4. Samir Mohammed 2020-06-17

    *Closing ticket* fix verified in SDK version 9.1.0.v20200615121135. Able to still use liveview when having a ti.include commented out e.g.
       //Ti.include('vendor/pubnub.js');
       
    *Test Environment*
       MacOS Catalina: 10.15.5 Beta
       Xcode: 11.4
       Java Version: 1.8.0_131
       Android NDK: 21.1.6273396-beta2
       Node.js: 10.16.3
       ""NPM":"5.0.0","CLI":"8.0.0""
       Andoird Pixel xl 7.1.1 Emulator 
       

JSON Source