cemersoz
cemersoz

Reputation: 43

meteor methods, 404 method not found

I'm trying to implement meteor methods, I have a very basic method implemented in client/lab/methods.ts. I'm calling it from client/lab/imports/pages/lab.ts. It runs as expected -I have a test console.log that executes-, but when I try to invoke a callback I get a 404 method not found error.

Here are the github gist for the access and define parts https://gist.github.com/cemersoz/223297d7decb8c578a5f925163df9e26

I saw this response to a similar question from 2 years ago https://stackoverflow.com/a/22307649/5675765

but I don't understand how I could implement that solution. Defining meteor.methods in server just resulted in a module not found error What do you think I may be doing wrong? Thanks!

Upvotes: 0

Views: 646

Answers (1)

cemersoz
cemersoz

Reputation: 43

So... I apparently need two functions, one in client and one in server side. (and to not forget to import the server side in main.js) Alternatively, I could have declared one method in a directory where both server and client could access it.

For me referencing the client side function worked. It executes both on the client side and the server side when I call it with myMethod.call

Upvotes: 0

Related Questions