[TIMOB-12111] iOS: Common JS module whose first folder segment is the name of a module will have the leading character removed.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-12-18T20:38:50.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.1, Release 3.1.0, 2012 Sprint 26 API, 2012 Sprint 26 |
Components | iOS |
Labels | module_module, qe-testadded, regression |
Reporter | Eric Merriman |
Assignee | Blain Hamon |
Created | 2012-12-17T22:38:41.000+0000 |
Updated | 2014-06-19T12:43:53.000+0000 |
Description
Chris reported an issue he discovered on the Q&A. An additional post was made, and they seem to follow the same pattern. At issue is a fix made only in master (so isn't in 2.1.4GA) where Stramer was removing the leading slash on the path.
This causes the leading character from some paths to be stripped (thinking it's a slash) and results in errors such as:
For me this happens on OS X, trying to run on the iPhone simulator from Studio. I try to do require('utils/ajax'), what I see happening in the logs is this:
[DEBUG] Loading: /Users/<user>/Library/Application Support/iPhone Simulator/6.0/Applications/ACD5693B-FEA7-4BCC-AA09-2C86829F8EB1/<app>.app/tils/ajax.js, Resource: tils/ajax_js [ERROR] Script Error = Couldn't find module: utils/ajax at app.js (line 0).
So the 'u' of 'utils' has somehow disappeared. The only change I made was upgrading to SDK 3.0.
When I changed the statement to require('uutils/ajax'), it (correctly) tries to load Resource: uutils/ajax_js and fails.
Interestingly, other require statements (like require('oauth/oauth')) do work.
Steps to repro:
1) Create project and use the attached (2) files and (1) Folder
2) Run the project
Results:
Will pass on the first and the third test, and will fail on the second.
Expected:
All three tests should pass.
Attachments
File | Date | Size |
---|---|---|
Test case.zip | 2012-12-17T22:38:41.000+0000 | 4875 |
https://github.com/appcelerator/titanium_mobile/pull/3615 pending.
For those experiencing the issue, please download the following build of the SDK: * OSX: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-osx.zip * Linux: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-linux.zip * Windows: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-win32.zip You may install these manually into your SDK folder, or using Studio's *Help > Install Titanium SDK...* menu option
Verified on: Studio: 3.0.1.201212181159 SDK: 3.0.1.v20130108154840, 3.1.0.v20130114171802 iOS Simulator 6.0 XCode: 4.5.2 CLI: 3.0.22