user1952811
user1952811

Reputation: 2468

Meteor Call returning 404 Method Not Found

        Meteor.call('create_question', title, content, function(error, result) {
            console.log('create_question error ' + error);
            console.log('create_question result ' + result);

            if (error) {

            } else {
                console.log('Your question was submitted');
            }
        });

This is my call Meteor call on the client.

and I've got this in the server.

Meteor.methods({
    create_question: function(question_title, question_content) {
// does stuff   
    },

});

But for some reason I keep getting Method is not found. Anyone know what's wrong? I've got the Meteor.methods in the server folder and the call in the client folder.

Upvotes: 1

Views: 1187

Answers (2)

Han
Han

Reputation: 5652

It may be that another method being called within your create_question method isn't defined.

That was my problem, but the error message still says that the create_question method is the one that's not defined.

Upvotes: 1

musically_ut
musically_ut

Reputation: 34288

The method create_question should be defined on both the client and the server.

You can use this.isSimulation to figure-out whether the Method is being executed on the server or the client (as a stub).

Upvotes: 2

Related Questions