Using Meteor 1.3 (1.3-beta.11), and I am trying to get jagi:astronomy to work. I have the following code to try and extend the user profile and user, per instructions here:
import {Meteor} from 'meteor/meteor';
export const UserProfile = Astro.Class({
name: 'UserProfile',
fields: {
nickname: 'string'
/* Any other fields you want to be published to the client */
}
});
export const User = Astro.Class({
name: 'User',
collection: Meteor.users,
fields: {
createdAt: 'date',
emails: {
type: 'array',
default: function() {
return [];
}
},
profile: {
type: 'object',
nested: 'UserProfile',
default: function() {
return {};
}
}
}
});
if (Meteor.isServer) {
User.extend({
fields: {
services: 'object'
}
});
}
But when the code runs I get:
W20160315-22:33:34.611(-4)? (STDERR)
W20160315-22:33:34.611(-4)? (STDERR) /Users/mbauer/.meteor/packages/meteor-tool/.1.1.13-beta.11.axy85y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
W20160315-22:33:34.611(-4)? (STDERR) throw(ex);
W20160315-22:33:34.611(-4)? (STDERR) ^
W20160315-22:33:34.611(-4)? (STDERR) Error: The "collection" property has to be an instance of the "Mongo.Collection" in the "User" class
W20160315-22:33:34.611(-4)? (STDERR) at Function.checkSchemaDefinition (packages/jagi_astronomy/lib/modules/storage/init_definition.js:227:1)
W20160315-22:33:34.611(-4)? (STDERR) at Function.onInitDefinitionStorage (packages/jagi_astronomy/lib/modules/storage/init_definition.js:248:1)
W20160315-22:33:34.612(-4)? (STDERR) at packages/jagi_astronomy/lib/modules/core/classes.js:27:1
W20160315-22:33:34.612(-4)? (STDERR) at packages/jagi_astronomy/lib/modules/core/events.js:68:1
W20160315-22:33:34.612(-4)? (STDERR) at Array.forEach (packages/es5-shim/.npm/package/node_modules/es5-shim/es5-shim.js:419:1)
W20160315-22:33:34.612(-4)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:105:1)
W20160315-22:33:34.612(-4)? (STDERR) at Object._.extend.each (packages/jagi_astronomy/lib/modules/core/events.js:64:1)
W20160315-22:33:34.612(-4)? (STDERR) at Function.methods.extend (packages/jagi_astronomy/lib/modules/core/classes.js:26:1)
W20160315-22:33:34.612(-4)? (STDERR) at Object.Astro.createClass.Astro.Class (packages/jagi_astronomy/lib/modules/core/classes.js:80:1)
W20160315-22:33:34.612(-4)? (STDERR) at meteorInstall.lib.collections.user.js (lib/collections/user.js:13:27)
=> Modified -- restarting.
W20160315-22:54:33.042(-4)? (STDERR)
W20160315-22:54:33.043(-4)? (STDERR) /Users/mbauer/.meteor/packages/meteor-tool/.1.1.13-beta.11.axy85y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
W20160315-22:54:33.043(-4)? (STDERR) throw(ex);
W20160315-22:54:33.043(-4)? (STDERR) ^
W20160315-22:54:33.108(-4)? (STDERR) Error: The "collection" property has to be an instance of the "Mongo.Collection" in the "User" class
W20160315-22:54:33.108(-4)? (STDERR) at Function.checkSchemaDefinition (packages/jagi_astronomy/lib/modules/storage/init_definition.js:227:1)
W20160315-22:54:33.108(-4)? (STDERR) at Function.onInitDefinitionStorage (packages/jagi_astronomy/lib/modules/storage/init_definition.js:248:1)
W20160315-22:54:33.108(-4)? (STDERR) at packages/jagi_astronomy/lib/modules/core/classes.js:27:1
W20160315-22:54:33.108(-4)? (STDERR) at packages/jagi_astronomy/lib/modules/core/events.js:68:1
W20160315-22:54:33.109(-4)? (STDERR) at Array.forEach (packages/es5-shim/.npm/package/node_modules/es5-shim/es5-shim.js:419:1)
W20160315-22:54:33.109(-4)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:105:1)
W20160315-22:54:33.109(-4)? (STDERR) at Object._.extend.each (packages/jagi_astronomy/lib/modules/core/events.js:64:1)
W20160315-22:54:33.109(-4)? (STDERR) at Function.methods.extend (packages/jagi_astronomy/lib/modules/core/classes.js:26:1)
W20160315-22:54:33.109(-4)? (STDERR) at Object.Astro.createClass.Astro.Class (packages/jagi_astronomy/lib/modules/core/classes.js:80:1)
W20160315-22:54:33.109(-4)? (STDERR) at meteorInstall.lib.collections.user.js (lib/collections/user.js:11:27)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
If I console.log the Meteor object I get something:
I20160315-22:33:34.495(-4)? { isProduction: false,
I20160315-22:33:34.495(-4)? isDevelopment: true,
I20160315-22:33:34.495(-4)? isClient: false,
I20160315-22:33:34.495(-4)? isServer: true,
I20160315-22:33:34.495(-4)? isCordova: false,
I20160315-22:33:34.496(-4)? settings: { public: {} },
I20160315-22:33:34.496(-4)? release: 'METEOR@1.3-beta.11',
I20160315-22:33:34.496(-4)? _get: [Function],
I20160315-22:33:34.496(-4)? _ensure: [Function],
I20160315-22:33:34.496(-4)? _delete: [Function],
I20160315-22:33:34.496(-4)? wrapAsync: [Function],
I20160315-22:33:34.496(-4)? _inherits: [Function],
I20160315-22:33:34.497(-4)? _wrapAsync: [Function],
I20160315-22:33:34.497(-4)? _setImmediate: { [Function] implementation: 'setImmediate' },
I20160315-22:33:34.497(-4)? setTimeout: [Function],
I20160315-22:33:34.497(-4)? setInterval: [Function],
I20160315-22:33:34.497(-4)? clearInterval: [Function],
I20160315-22:33:34.497(-4)? clearTimeout: [Function],
I20160315-22:33:34.498(-4)? defer: [Function],
I20160315-22:33:34.498(-4)? makeErrorType: [Function],
I20160315-22:33:34.498(-4)? Error:
I20160315-22:33:34.498(-4)? { [Function]
I20160315-22:33:34.498(-4)? captureStackTrace: [Function: captureStackTrace],
I20160315-22:33:34.498(-4)? stackTraceLimit: 10,
I20160315-22:33:34.499(-4)? prepareStackTrace: [Function: prepareStackTrace],
I20160315-22:33:34.499(-4)? __super__: [Error] },
I20160315-22:33:34.499(-4)? _noYieldsAllowed: [Function],
I20160315-22:33:34.499(-4)? _DoubleEndedQueue: [Function: Deque],
I20160315-22:33:34.499(-4)? _SynchronousQueue: [Function],
I20160315-22:33:34.499(-4)? _sleepForMs: [Function],
I20160315-22:33:34.500(-4)? startup: [Function],
I20160315-22:33:34.500(-4)? _debug: [Function],
I20160315-22:33:34.500(-4)? _suppress_log: [Function],
I20160315-22:33:34.500(-4)? _suppressed_log_expected: [Function],
I20160315-22:33:34.500(-4)? _escapeRegExp: [Function],
I20160315-22:33:34.500(-4)? _nodeCodeMustBeInFiber: [Function],
I20160315-22:33:34.500(-4)? EnvironmentVariable: [Function],
I20160315-22:33:34.501(-4)? bindEnvironment: [Function],
I20160315-22:33:34.501(-4)? absoluteUrl: { [Function] defaultOptions: { rootUrl: 'http://localhost:3000/' } },
I20160315-22:33:34.501(-4)? _relativeToSiteRootUrl: [Function],
I20160315-22:33:34.501(-4)? flush: [Function],
I20160315-22:33:34.501(-4)? autorun: [Function],
I20160315-22:33:34.501(-4)? autosubscribe: [Function],
I20160315-22:33:34.502(-4)? uuid: [Function],
I20160315-22:33:34.502(-4)? server:
I20160315-22:33:34.502(-4)? { options:
I20160315-22:33:34.502(-4)? { heartbeatInterval: 15000,
I20160315-22:33:34.503(-4)? heartbeatTimeout: 15000,
I20160315-22:33:34.503(-4)? respondToPings: true },
I20160315-22:33:34.503(-4)? onConnectionHook:
I20160315-22:33:34.503(-4)? { nextCallbackId: 0,
I20160315-22:33:34.503(-4)? callbacks: {},
I20160315-22:33:34.503(-4)? bindEnvironment: true,
I20160315-22:33:34.504(-4)? exceptionHandler: 'onConnection callback' },
I20160315-22:33:34.504(-4)? publish_handlers: { meteor_autoupdate_clientVersions: [Function] },
I20160315-22:33:34.504(-4)? universal_publish_handlers: [],
I20160315-22:33:34.504(-4)? method_handlers:
I20160315-22:33:34.504(-4)? { '/queue/insert': [Function],
I20160315-22:33:34.504(-4)? '/queue/update': [Function],
I20160315-22:33:34.504(-4)? '/queue/remove': [Function],
I20160315-22:33:34.505(-4)? '/queuelog/insert': [Function],
I20160315-22:33:34.569(-4)? '/queuelog/update': [Function],
I20160315-22:33:34.569(-4)? '/queuelog/remove': [Function],
I20160315-22:33:34.569(-4)? '/queueintervals/insert': [Function],
I20160315-22:33:34.569(-4)? '/queueintervals/update': [Function],
I20160315-22:33:34.569(-4)? '/queueintervals/remove': [Function],
I20160315-22:33:34.570(-4)? '/applications/insert': [Function],
I20160315-22:33:34.570(-4)? '/applications/update': [Function],
I20160315-22:33:34.570(-4)? '/applications/remove': [Function],
I20160315-22:33:34.570(-4)? '/log_sets/insert': [Function],
I20160315-22:33:34.570(-4)? '/log_sets/update': [Function],
I20160315-22:33:34.570(-4)? '/log_sets/remove': [Function],
I20160315-22:33:34.570(-4)? '/log_files/insert': [Function],
I20160315-22:33:34.570(-4)? '/log_files/update': [Function],
I20160315-22:33:34.571(-4)? '/log_files/remove': [Function],
I20160315-22:33:34.571(-4)? '/log_entries/insert': [Function],
I20160315-22:33:34.571(-4)? '/log_entries/update': [Function],
I20160315-22:33:34.571(-4)? '/log_entries/remove': [Function] },
I20160315-22:33:34.571(-4)? sessions: {},
I20160315-22:33:34.571(-4)? stream_server:
I20160315-22:33:34.571(-4)? { registration_callbacks: [Object],
I20160315-22:33:34.571(-4)? open_sockets: [],
I20160315-22:33:34.572(-4)? prefix: '/sockjs',
I20160315-22:33:34.572(-4)? server: [Object] } },
I20160315-22:33:34.572(-4)? refresh: [Function],
I20160315-22:33:34.572(-4)? publish: [Function],
I20160315-22:33:34.572(-4)? methods: [Function],
I20160315-22:33:34.572(-4)? call: [Function],
I20160315-22:33:34.572(-4)? apply: [Function],
I20160315-22:33:34.572(-4)? onConnection: [Function],
I20160315-22:33:34.573(-4)? default_server:
I20160315-22:33:34.573(-4)? { options:
I20160315-22:33:34.573(-4)? { heartbeatInterval: 15000,
I20160315-22:33:34.573(-4)? heartbeatTimeout: 15000,
I20160315-22:33:34.573(-4)? respondToPings: true },
I20160315-22:33:34.573(-4)? onConnectionHook:
I20160315-22:33:34.573(-4)? { nextCallbackId: 0,
I20160315-22:33:34.573(-4)? callbacks: {},
I20160315-22:33:34.574(-4)? bindEnvironment: true,
I20160315-22:33:34.574(-4)? exceptionHandler: 'onConnection callback' },
I20160315-22:33:34.574(-4)? publish_handlers: { meteor_autoupdate_clientVersions: [Function] },
I20160315-22:33:34.574(-4)? universal_publish_handlers: [],
I20160315-22:33:34.574(-4)? method_handlers:
I20160315-22:33:34.574(-4)? { '/queue/insert': [Function],
I20160315-22:33:34.574(-4)? '/queue/update': [Function],
I20160315-22:33:34.574(-4)? '/queue/remove': [Function],
I20160315-22:33:34.575(-4)? '/queuelog/insert': [Function],
I20160315-22:33:34.575(-4)? '/queuelog/update': [Function],
I20160315-22:33:34.575(-4)? '/queuelog/remove': [Function],
I20160315-22:33:34.575(-4)? '/queueintervals/insert': [Function],
I20160315-22:33:34.575(-4)? '/queueintervals/update': [Function],
I20160315-22:33:34.575(-4)? '/queueintervals/remove': [Function],
I20160315-22:33:34.576(-4)? '/applications/insert': [Function],
I20160315-22:33:34.576(-4)? '/applications/update': [Function],
I20160315-22:33:34.576(-4)? '/applications/remove': [Function],
I20160315-22:33:34.576(-4)? '/log_sets/insert': [Function],
I20160315-22:33:34.576(-4)? '/log_sets/update': [Function],
I20160315-22:33:34.576(-4)? '/log_sets/remove': [Function],
I20160315-22:33:34.576(-4)? '/log_files/insert': [Function],
I20160315-22:33:34.577(-4)? '/log_files/update': [Function],
I20160315-22:33:34.577(-4)? '/log_files/remove': [Function],
I20160315-22:33:34.577(-4)? '/log_entries/insert': [Function],
I20160315-22:33:34.577(-4)? '/log_entries/update': [Function],
I20160315-22:33:34.577(-4)? '/log_entries/remove': [Function] },
I20160315-22:33:34.577(-4)? sessions: {},
I20160315-22:33:34.577(-4)? stream_server:
I20160315-22:33:34.577(-4)? { registration_callbacks: [Object],
I20160315-22:33:34.577(-4)? open_sockets: [],
I20160315-22:33:34.578(-4)? prefix: '/sockjs',
I20160315-22:33:34.578(-4)? server: [Object] } },
I20160315-22:33:34.578(-4)? Collection:
I20160315-22:33:34.578(-4)? { [Function]
I20160315-22:33:34.578(-4)? _publishCursor: [Function],
I20160315-22:33:34.578(-4)? _rewriteSelector: [Function],
I20160315-22:33:34.578(-4)? Cursor: [Function],
I20160315-22:33:34.578(-4)? ObjectID: [Function] } }
I am sure I am doing something wrong, but I am not sure what.