[TIMOB-15929] Parity: Android should support require-ing .json files like on iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-07-08T22:29:57.000+0000 |
Affected Version/s | Release 3.2.0, Release 3.2.1 |
Fix Version/s | n/a |
Components | Android |
Labels | android, json, module, parity, require |
Reporter | Fokke Zandbergen |
Assignee | Eric Merriman |
Created | 2013-12-06T15:17:11.000+0000 |
Updated | 2017-07-20T19:11:03.000+0000 |
Description
In iOS, you can do:
var object = require('data.json');
On Android, you can't and get:
[ERROR] TiExceptionHandler: (main) [545,551] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,551] - In ti:/module.js:280,9
[ERROR] TiExceptionHandler: (main) [0,551] - Message: Uncaught Error: Requested module not found: data/book.json
[ERROR] TiExceptionHandler: (main) [0,551] - Source: throw new Error("Requested module not found: " + request);
This should be quite easy to add to:
https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/common/src/js/module.js
Hi Fokke, Thanks for submitting this request. I have moved your request to TIMOB so that Engineering can consider this for future release. If you have any question or comment, please feel free to post it here. Regards,
This is supported in 6.0 as part of the major require-changes.
Closing as duplicate.