[TIMOB-20274] Hyperloop: Plugin fails if the source does not contain HL references
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-04-08T08:41:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Hyperloop 2.1.0 |
Components | Hyperloop |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Jan Vennemann |
Created | 2016-01-26T21:39:19.000+0000 |
Updated | 2017-05-05T13:05:30.000+0000 |
Description
As found by [~developer82] and reported on [Stack Overflow](http://stackoverflow.com/questions/34999704/hyperloop-compilation-error) the Hyperloop plugin fails when the source of the app does not actually use Hyperloop. It will crash with:
[INFO] Skipping Hyperloop compile, no usage found …
[TRACE] Symbol references up-to-date
[DEBUG] Skipping stub generation
/Users/fokkezb/dev/tests/nohl/plugins/hyperloop/hooks/ios/hyperloop.js:581
return callback();
^
ReferenceError: callback is not defined
PR incoming
PR on master: https://github.com/appcelerator/hyperloop.next/pull/3
Reopening this issue, since it would break default hyperloop-based projects using hyperloop.next master. Please validate [~fokkezb], it might be related to leaving out [this](https://github.com/appcelerator/hyperloop.next/pull/3/files#diff-885c43ae7ca7944399f2103332eb9419L669) line.
Thanks [~hansknoechel], my fix mixed up async and async style Fix: https://github.com/appcelerator/hyperloop.next/pull/5
Approved, now working as expected! [~cng] The fix-version is 5.2.1, does this relate to the SDK or just for the QE to test?
A bit of both actually. but since hyper loop hasn't graduated from labs, I don't think QE has a test plan for this. So I'll remove the fixVersion for now til hyper loop becomes GA.
Closing ticket as fixed. Verified that you can build a mobile project without any reference to Hyperloop, even though it's enabled for your project. Tested on: Appcelerator Studio, build: 4.7.0.201607130543 Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-33 Arrow: 1.8.2 SDK: 5.4.0.v20160713141635 Hyperloop: 1.2.3 Node: v4.4.7 OS: Mac OS X (10.11.5) Xcode: 7.3.1 Devices: iphone 6 plus (9.1)
[~hansknoechel] -- I know this is marked as closed but we started seeing this 2.0.1 for a few different apps. The same apps did not have any problems when running 2.0.0. Unfortunately, it seems to happen randomly with no changes to the app. The only way to be sure it doesn't crash is to comment out the hyperloop references in tiapp.xml. {noformat} [DEBUG] Removing empty directories [INFO] Starting Hyperloop assembly [INFO] Skipping Hyperloop compile, no usage found ... [TRACE] Forcing regeneration of wrappers [DEBUG] Generating stubs 2017-03-28T21:45:09.325Z | ERROR | An uncaught exception was thrown! Cannot convert undefined or null to object 2017-03-28T21:45:09.326Z | ERROR | Cannot convert undefined or null to object Brentons-MacBook-Pro:titanium-template brenton$ clear && npm run build:ios {noformat}
[~brentonhouse] I also encounter this with Hyperloop 2.0.1 and will be investigating it further. The error better matches AC-703, which was marked as a duplicate of this issue.
Encountered this again during smoke tests. As mentioned, adding Hyperloop references or removing the module allows the project to build. [~hansknoechel], have you encountered this since its closing?
[~ewieber], this is indeed a regression in 2.0.1. This PR will prevent the error by stopping the Hyperloop compile process early if no usage found, so that the following steps won't be run with incomplete data which caused the error in this case. PR (master): https://github.com/appcelerator/hyperloop.next/pull/145 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/146
Verified fix with the following environment: Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.0 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.0.3.GA Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.2.1 Hyperloop 2.1.0 iOS 10, and Android 6.0 Built to simulator/emulator and device, and found no errors for hyperloop-enabled apps with no hyperloop references.