Crash in mdg:validated-method

I’m using validated-method to created a insert method but it crash to run meteor with the next message:

W20160221-11:32:45.394(1)? (STDERR) /home/abayta/Desktop/webstormWorkspace/nutrideta/.meteor/local/build/programs/server/app/lib/collections/recipes.js:87
W20160221-11:32:45.394(1)? (STDERR) run() {
W20160221-11:32:45.394(1)? (STDERR) ^
W20160221-11:32:45.396(1)? (STDERR) SyntaxError: Unexpected token (
W20160221-11:32:45.396(1)? (STDERR) at /home/abayta/Desktop/webstormWorkspace/nutrideta/.meteor/local/build/programs/server/boot.js:241:30
W20160221-11:32:45.396(1)? (STDERR) at Array.forEach (native)
W20160221-11:32:45.396(1)? (STDERR) at Function..each..forEach (/home/abayta/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160221-11:32:45.396(1)? (STDERR) at /home/abayta/Desktop/webstormWorkspace/nutrideta/.meteor/local/build/programs/server/boot.js:137:5

The code is:

Recipes = new Mongo.Collection(‘recipes’);

recipeSchema = new SimpleSchema({
name: {
type: String,
label: “Name”
},
description: {
type: String,
label: “Description”
},
preparation: {
type: String,
label: “Preparation”
},
preparationTime: {
type: String,
label: “Preparation Time”
},
energy: {
type: Number,
label: “Energy”
},
fats: {
type: Number,
label: “Fats”
},
carbohydrates: {
type: Number,
label: “Carbohydrates”
},
protein: {
type: Number,
label: “Protein”
},
author: {
type: String,
label: “Author”,
autoValue: function() {
return this.userId;
},
autoform: {
type: “hidden”
}
},
createdAt: {
type: Date,
label: “Created At”,
autoValue: function() {
return new Date();
},
autoform: {
type: “hidden”
}
}
});

Recipes.attachSchema(recipeSchema);

Recipes.methods = {};

Recipes.methods.newRecipe = new ValidatedMethod({
name: ‘Recipes.methods.newRecipe’,
validate: recipeSchema.validator(),
run(){

}

});

It crash too with the example method of mdg:validated-method from github.

What I am doing wrong? I am going mad.

Hi there, would be helpful to make a small reproduction app in github and share with us. Also, it’s nice to format your code in these posts by wrapping it with backticks (`) or using the </> button in the toolbar.

I found the problem!! I had to add ecmascript package that let you use new JavaScript language features that are part of the ECMAScript 2015 specification but are not yet supported by all engines or browsers

Thanks @energistic because I found the problem when I was making a reproduction app and for the advise to write in the forum, I am new.