Saturday, March 15, 2014

The Moral of this Story: Post Working Code to Your Repo ASAP (a.k.a. I love github)

Last night, lying in bed and ready to go to sleep, I did something that I do not like to start late in the evening. I decided to open my Meteor app and check for any updates that I would need to make. Following that initial move, I just spent the following hour messing with an update to Meteor and authentication with facebook. What was happening was that after I updated the app I attempted to start it up and was getting the following error:

W20140315-08:39:31.394(-4)? (STDERR) TypeError: Cannot call method 'remove' of undefined
W20140315-08:39:31.394(-4)? (STDERR)     at app/server/facebook_login.js:1:71
W20140315-08:39:31.394(-4)? (STDERR)     at app/server/facebook_login.js:11:3
W20140315-08:39:31.395(-4)? (STDERR)     at /home/mark/meteor/m2smgrpdaily/.meteor/local/build/programs/server/boot.js:155:10
W20140315-08:39:31.395(-4)? (STDERR)     at Array.forEach (native)
W20140315-08:39:31.395(-4)? (STDERR)     at Function._.each._.forEach (/home/mark/.meteor/tools/8d9edffd4f/lib/node_modules/underscore/underscore.js:79:11)
W20140315-08:39:31.395(-4)? (STDERR)     at /home/mark/meteor/m2smgrpdaily/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8

To fix you need to add a smart-package manually:
$meteor add service-configuration
Then change any code with: Accounts.loginServiceConfiguration.remove({}) to ServiceConfiguration.configurations.remove({}). This I did in  /home/mark/meteor/m2smgrpdaily/server/facebook_login.js and was good to go. Without hesitating, I pushed the fix to my github repo.

This Meteor update issue, that was found last night, was found while using my netbook. This morning I opened the app on my desktop and of course found the same thing. To correct it I simply pulled from my github repo, that I updated last night after fixing the code on the netbook, restarted the app, and I was good to go. 

Therefore, push working code to your repo ASAP!