Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24170] LiveView breaks relative path usage in require

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-06T06:47:06.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sn/a
ComponentsAndroid, iOS, LiveView
LabelsLiveView, alloy, path, relative, require
ReporterBrenton House
AssigneeFeon Sua Xin Miao
Created2016-11-23T18:58:11.000+0000
Updated2018-08-06T17:57:34.000+0000

Description

When requiring a module using relative paths, an app will error out if LiveView is running.
var require_absolute_path = require('/test/myModule');
console.error('require_absolute_path: ' + require_absolute_path);

var require_relative_path = require('./myModule');
console.error('require_relative_path: ' + require_relative_path);
[INFO]  [LiveView] Error Evaluating /test/requireTest.js @ Line: <null>
[ERROR] Couldn't find module: ./myModule for architecture: x86_64
[ERROR] File: /test/requireTest.js
[ERROR] Line: <null>
[ERROR] SourceId: <null>
[ERROR] Backtrace:
[ERROR] undefined

Comments

  1. Hans Knöchel 2016-11-27

    [~brentonhouse] Is this only happening on 6.0.0+? And is it iOS, Android or both?
  2. Brenton House 2016-11-28

    [~hansknoechel] I will test on Android and update the ticket with findings.
  3. Brenton House 2016-11-28

    Failed on Android as well:
       [ERROR] TiHTTPClient: (TiHttpClient-12) [1738,1738] HTTP Error (java.io.IOException): 404 : Not Found
       [ERROR] TiHTTPClient: java.io.IOException: 404 : Not Found
       [ERROR] TiHTTPClient: 	at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1217)
       [ERROR] TiHTTPClient: 	at java.lang.Thread.run(Thread.java:818)
       [INFO]  [LiveView] Error Evaluating /test/requireTest.js @ Line: undefined
       [ERROR] Error: Requested module not found: ./myModule
       [ERROR] File: /test/requireTest.js
       [ERROR] Line: undefined
       [ERROR] SourceId: undefined
       [ERROR] Backtrace:
       [ERROR] undefined
       
       
  4. Feon Sua Xin Miao 2017-08-09

    PR: https://github.com/appcelerator/liveview/pull/105
  5. Abir Mukherjee 2017-08-17

    [~ssekhri] Are you doing the FR for this one? This one should be a Studio FR.
  6. Satyam Sekhri 2017-08-17

    [~amukherjee] As soon as it is merged into studio. The merge ticket is already planned for this sprint but we would take it on priority.
  7. Abir Mukherjee 2017-08-28

    [~ssekhri] This ticket should actually be a Studio 4.10 ticket. Would you be able to move the fixVersion to the correct version?
  8. Feon Sua Xin Miao 2017-09-06

    Fixed in liveview@1.2.1.
  9. Eric Merriman 2018-08-06

    Cleaning up older fixed tickets from 2016 and earlier. If this ticket should not have been closed, please reopen it.

JSON Source