How to fix "Hyperloop.defineClass must return a class definition into a variable" exception in Titanium?

132 views Asked by At

I'm trying to do the simplest thing in Appcelerator Hyperloop to define/create my own class, but it's causing my builds to fail (can't build for the simulator or a device) with a build-time error from the console.

I just started with a new blank Alloy project and added a single line to the top of index.js to test it:

var MyFooClass = Hyperloop.defineClass('MyFooClass', 'NSObject');

The syntax I'm using is what I've seen all over the place in the Appcelerator docs and even their own example app: https://github.com/appcelerator/hyperloop-examples/blob/master/app/lib/ios/subclasses/locationmanagerdelegate.js

The error I get from the console/terminal is:

An uncaught exception was thrown!
Hyperloop.defineClass must return a class definition into a variable

My environment:

Mac OSX 10.11.6
Titanium SDK 6.0.1.GA
Alloy 1.9.5
Hyperloop 2.0.0
Appcelerator Studio 4.8.1.201612050850
1

There are 1 answers

0
Hans Knöchel On

I have not seen this issue before, but it seems like it's fixed in more recent versions of Hyperloop (3.0.2 at this point). You can report any issues on the Appcelerator Bug Tracker to have them validated, I hope that helps!