Registering static methods are remote methods in Loopback 2.0

Loopback 2.0 and getting:

/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot call method ‘apply’ of undefined
at SharedMethod.invoke /node_modules/loopback/node_modules/strong-remoting/lib/shared-method.js:213:17)

Reason is more than likely that you have defined a static method on your model that does not match the string used to register the static method as a remote method as outline here.

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: