Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6602] Android: CommonJS Relative path in require() statement prevents file from loading

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-26T08:52:38.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sRelease 3.0.0
ComponentsAndroid
Labelsmodule_require, qe-testadded
ReporterTim Poulsen
AssigneeIngo Muschenetz
Created2011-12-13T07:32:37.000+0000
Updated2014-06-19T12:44:37.000+0000

Description

Expected: require('ui').createMainWindow().open() should load module and call methods Actual: throws file not found error; need to use require('/ui').createMainWindow().open() Attached file demonstrates problem. The relative path worked in 1.7.6 and the CI build of 1.8 noted in the code comments

Attachments

FileDateSize
RequireTest_updated.zip2011-12-15T08:03:14.000+00002320583
RequireTest.zip2011-12-13T07:32:37.000+00002320933

Comments

  1. Tim Poulsen 2011-12-15

    Updated in attempt to fix my bug-filing faux pas.
  2. Max Stepanov 2012-12-11

    Confirmed to work in 3.0.0.
  3. Tamila Smolich 2012-12-18

    Closing as fixed. Tested and verified on: Titanium Studio, build: 3.0.0.201212131639 Titanium SDK, build: 3.0.0.v20121212184921 Device: LG Nexus 4 (4.2)
  4. Priya Agarwal 2013-07-26

    Reopening just to update label.
  5. Priya Agarwal 2013-07-26

    Updated label. Closing as fixed. Verified with: Verified with: Studio: 3.1.1.201306131423 SDK: 3.1.2.v20130725180746 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device: HTC Desire(v4.0.3),iphone Simulator(v6.0) CommonJS Relative path in require() statement working well.

JSON Source