I'm attempting to implement an iOS delegate in a NativeScript plugin and am getting an error:
Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: __metadata
My original code is:
@ObjCClass(SQRDCheckoutControllerDelegate)
export class SquareReader extends NSObject implements SQRDCheckoutControllerDelegate {
/*
iOS delegate implementation here
(source https://docs.connect.squareup.com/payments/readersdk/setup-ios)
*/
}
And that's getting transpiled in js down to:
SquareReader = __decorate([
ObjCClass(exports.SQRDCheckoutControllerDelegate),
__metadata("design:paramtypes", [])
], SquareReader);
If I just remove the __metadata line, I get a different error:
Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Protocol "undefined" is not a protocol object.
Any ideas? I've seen other examples like nativescript-image-swipe where the code is being transpiled w/o the __metadata method leading me to think something might be wrong with the transpilation