Found an error in the Meteor guide code - now what?

Hi guys,

I’ve found an error in the following code example (http://guide.meteor.com/data-loading.html):

Meteor.publish('Todos.inList', function(listId) {
  // We need to check the `listId` is the type we expect
  new SimpleSchema({
    listId: {type: String}
  }).validate({ listId });

  // ...
});

.validate() needs an object but .validate({ listId }); produces an error for me:

SyntaxError: Unexpected token }

pointing to the closing curly bracket:

}).validate({oneToManyContent});
                             ^

Using Meteor 1.2.1 and aldeed:simple-schema@1.5.3

Am I doing something wrong here? oneToManyContent is a string, actually the content of a textarea. I’m using it in a Meteor.methods call on the server end (actually in my backend app as I have both frontend and backend running as two separate apps).

If not, how can I report the error in the Meteor guide back to the guys who wrote it?

Looks okay to me, is your project using the ecmascript package?

Yes:

ecmascript@0.1.6
ecmascript-runtime@0.2.6

Does the publication live in your application or within a package? If it’s in a package you’ll need to api.use('ecmascript@0.1.6'); in your package.js

The Guide has it’s own repo on github, so you could file an issue or PR there https://github.com/meteor/guide. It’s easier for MDG to accept PRs into the guide.

2 Likes

This is my list of packages:

standard-minifiers
meteor-base
mobile-experience
mongo
blaze-html-templates
session
jquery
tracker
logging
reload
random
ejson
spacebars
check

vsivsi:job-collection
useraccounts:bootstrap
accounts-password
aldeed:simple-schema

I don’t see it mentioned here so I assume it’s probably part of one of the first part of packages. The later part are those that I added manually.

I have to admit though @dburles that I don’t get your answer :blush:

ecmascript is not in your list of packages, so it’s not being run against your code. It’s appearing in your versions file as a result of it being used in a package.

You need to meteor add ecmascript to your project.

1 Like