Has anyone tried to get the node-uber npm package to work? Simply adding
var Uber = require('node-uber');
causes iron-router to lose all it’s routes. The problem seems to actually be with the oauth npm package since
var OAuth = require('oauth');
has the same effect. I was hoping to be able to use node-uber instead of hacking one of the Meteor account-oauth packages, but it is either that or debug the node oauth package. I’m really beginning to hate OAuth. 
So I learned something useful about JavaScript. I was putting the require
statement at the top of the source along with the import
statements. Seemed like a good idea so I could look and the top of the code and know what is needed. However this apparently puts everything in global scope which was messing up iron-router
. Moving the require
to just before I need to use it fixed the problem. Easy fix, but now I need to go through the rest of my code and move the require
statements for consistency even though they are working. I’m leaving this here in-case someone else can benefit from my mistake.
EDIT:
Wrapping the code inside if (Meteor.isServer)
also fixes the problem.