simpl-schema: Error: Invalid definition for pick field

I get the following at Meteor startup which throws it into a death cycle. Any ideas?

Error: Invalid definition for pick field

To use SS, I’m doing the following (if it helps): File 1: import PersonSchema from '../../api/person/schema.js'; Members.attachSchema(PersonSchema);

File 2: import SimpleSchema from 'simpl-schema'; const PersonSchema = new SimpleSchema({ ... }); export default PersonSchema;

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 18

Most upvoted comments

meteor remove aldeed:simple-schema aldeed:collection2
meteor add aldeed:collection2-core@2.0.0

It helped me

Thanks guys, fixed it for me too ^^

Hmm… weird! I created new meteor project and tried this also. As you can see we have really different version of collection2-core.

 meteor add aldeed:collection2-core

Changes to your project's package version selections:

aldeed:collection2-core      added, version 2.0.1
raix:eventemitter            added, version 0.1.3
tmeasday:check-npm-versions  added, version 0.3.1


aldeed:collection2-core: Core package for aldeed:collection2

I think this is going to fix it for you: meteor add aldeed:collection2-core@2.0.1

@lehtu Thank You for the suggestion! it worked for me

That worked for me. Thanks for the suggestion! It’s weird that in my environment, 1.2.0 came down as the default version when I didn’t specify.

I did notice a difference between your output and mine. In my project, check-npm-versions was already installed, so for me, it was updated, whereas for you, it was added. I wonder if having an old version of check-npm-versions had something to do with why it pulled the old version of collection2 for me.

No it does not install aldeed:simple-schema: https://github.com/aldeed/meteor-collection2-core/blob/master/package/collection2/package.js

You should uninstall and remove meteor version of simple-schema: meteor remove aldeed:simple-schema

and remove old collection2 meteor remove aldeed:collection2

after that install collection2-core and npm version of simpl-schema

meteor add aldeed:collection2-core
meteor npm install --save simpl-schema

and to get rid of that error you need to make sure that you are using latest version of npm version of simpl-schema and also that nothing in packages/ is using collection2 nor meteor version of simpl-schema.

@hues0 that’s probably because OrionJS still relies on meteor/aldeed:simple-schema. OrionJS is deprecated, btw, succeeded by Scorpius.js: https://github.com/scorpiusjs/scorpius Still doesn’t use node-simple-schema, but closer.