[TIMOB-27465] CLI: Fails to build app when including ti.superagent commonjs module
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-10-30T18:01:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | node-titanium-sdk 3.2.2, Release 8.3.0 |
Components | CLI |
Labels | engSchedule |
Reporter | Joshua Quick |
Assignee | Christopher Williams |
Created | 2019-10-11T12:54:43.000+0000 |
Updated | 2019-10-30T18:01:29.000+0000 |
Description
When including ti.superagent commons module in a project with SDK 8.2.1 and CLI 7.1.1, it reports a failure during app build:
[INFO] Processing JavaScript files
(node:6745) UnhandledPromiseRejectionWarning: TypeError: trace_error.stack[1].getFunctionName is not a function
at process.emitWarning (internal/process/warning.js:146:18)
at showFlaggedDeprecation (buffer.js:159:11)
at new Buffer (buffer.js:174:3)
at Array.<anonymous> (/Users/jquick2/.appcelerator/install/7.1.1/package/node_modules/source-map-support/source-map-support.js:149:21)
at /Users/jquick2/.appcelerator/install/7.1.1/package/node_modules/source-map-support/source-map-support.js:53:24
at mapSourcePosition (/Users/jquick2/.appcelerator/install/7.1.1/package/node_modules/source-map-support/source-map-support.js:171:21)
at Object.wrapCallSite (/Users/jquick2/.appcelerator/install/7.1.1/package/node_modules/source-map-support/source-map-support.js:343:20)
(node:6745) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:6745) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is a result of the single JS file in that module having a sourceMappingURL comment at the end of the file pointing at a mapping file not included in the module. node-titanium-sdk does not properly handle when the sourceMappingURL points at an invalid file (i.e. it doesn't exist or fails to load as JSON).
https://github.com/appcelerator/node-titanium-sdk/pull/123
node-titanium-sdk PR merged, needs bumped in the SDK
SDK PR: https://github.com/appcelerator/titanium_mobile/pull/11276
To test: Must be a classic project, ti.superagent can be got from the zip at https://github.com/appcelerator-modules/ti.superagent/releases/tag/v0.1.0. Extract the project and add it to the Resources directory of a classic app and then build the app
FR Passed. The app with ti.superagent module build successfully on android and iOS. Waiting on Jenkins build
merged to master
Verified On: Mac OS: 10.14.5 SDK: 8.3.0.v20191030085531 Appc CLI: 7.1.1 JDK: 1.8.0_162 Node: 10.5.0 Studio: 5.1.4.201909061933 Xcode: 11.1