Reputation: 789
After upgrading Meteor version to 1.3 from 1.2 i'm getting this error:
=> Started proxy.
=> Started MongoDB.
W20160130-14:27:48.841(3)? (STDERR)
W20160130-14:27:48.841(3)? (STDERR) C:\Users\Vladimir\AppData\Local\.meteor\pack
ages\meteor-tool\1.1.12-modules.5\mt-os.windows.x86_32\dev_bundle\server-lib\nod
e_modules\fibers\future.js:245
W20160130-14:27:48.841(3)? (STDERR)
throw(ex);
W20160130-14:27:48.841(3)? (STDERR)
^
W20160130-14:27:48.841(3)? (STDERR) ReferenceError: Games is not defined
W20160130-14:27:48.841(3)? (STDERR) at meteorInstall.lib.collections.js (lib
/collections.js:1:1)
W20160130-14:27:48.841(3)? (STDERR) at fileEvaluate (packages/modules-runtim
e/.npm/package/node_modules/install/install.js:183:1)
W20160130-14:27:48.841(3)? (STDERR) at require (packages/modules-runtime/.np
m/package/node_modules/install/install.js:75:1)
W20160130-14:27:48.841(3)? (STDERR) at C:\code\steambot\.meteor\local\build\
programs\server\app\app.js:404:1
W20160130-14:27:48.841(3)? (STDERR) at C:\code\steambot\.meteor\local\build\
programs\server\boot.js:242:10
W20160130-14:27:48.841(3)? (STDERR) at Array.forEach (native)
W20160130-14:27:48.841(3)? (STDERR) at Function._.each._.forEach (C:\Users\V
ladimir\AppData\Local\.meteor\packages\meteor-tool\1.1.12-modules.5\mt-os.window
s.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20160130-14:27:48.841(3)? (STDERR) at C:\code\steambot\.meteor\local\build\
programs\server\boot.js:137:5
=> Exited with code: 8
My file structure:
-.meteor
-client
-server
-public
-lib (collections.js here)
collections.js:
Games = new Mongo.Collection('games');
Before upgrading to 1.3 everything worked fine.
Upvotes: 1
Views: 1281
Reputation: 990
In Meteor 1.3 recommended way would be to use import
instead of moving everything into global.
// collections.js
export const Games = new Mongo.Collection('games');
then
// any_other_file.js
import { Games } from '../lib/collections'
Upvotes: 4
Reputation: 4094
Instead of
Games = new Mongo.Collection('games');
do
global.Games = new Mongo.Collection('games');
becouse
In beta 5, globals are having issues.
More info: https://github.com/meteor/meteor/issues/5788#issuecomment-175927524
Upvotes: 2