Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25826] Android: Error requiring a file by relative path where module.exports is a falsey value

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-04-24T14:19:28.000+0000
Affected Version/sRelease 7.1.0, Release 7.0.2, Release 7.2.0
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsparity
ReporterEwan Harris
AssigneeEwan Harris
Created2018-03-01T12:53:49.000+0000
Updated2018-06-12T19:19:20.000+0000

Description

Description

When a script that exports a falsey value undefined, null, false is required by a relative path ./foo the module will 'fail' to be found throwing the below error
[ERROR] TiExceptionHandler: (main) [20,20] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,20] - In ti:/module.js:303,2
[ERROR] TiExceptionHandler: (main) [0,20] - Message: Uncaught Error: Requested module not found: ./foo
[ERROR] TiExceptionHandler: (main) [0,20] - Source: 	throw new Error('Requested module not found: ' + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?

Steps to reproduce

1. Download the attached app 2. Build for android

Actual

The following is logged
[INFO]  empty-double threw
[INFO]  empty-single threw
[INFO]  false threw
[INFO]  nan threw
[INFO]  null threw
[INFO]  undefined threw
[INFO]  zero threw

Expected

The following is logged
[INFO]  empty-double worked
[INFO]  empty-single worked
[INFO]  false worked
[INFO]  nan worked
[INFO]  null worked
[INFO]  undefined worked
[INFO]  zero worked

Attachments

FileDateSize
jiratestapp.zip2018-03-01T13:31:18.000+00005546062

Comments

  1. Ewan Harris 2018-03-01

    https://github.com/appcelerator/titanium_mobile/pull/9897
  2. Samir Mohammed 2018-06-12

    Closing ticket. Fix can be seen in SDK Version: 7.3.0.v20180607210411 Other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/9897

JSON Source