title: Node.js mongoose module failing on Heroku
body: <p>Starting a couple days ago, our site <strong><a href="http://emaildelivery.herokuapp.com" rel="nofollow">http://emaildelivery.herokuapp.com</a></strong> displays an Application Error:</p>
  
  <blockquote>
    <p>"An error occurred in the application and your page could not be
    served. Please try again in a few moments.</p>
    
    <p>If you are the application owner, check your logs for details."</p>
  </blockquote>
  
  <p><strong>Our Heroku log shows:</strong></p>
  
  <pre><code>Jan 11 03:37:47 emaildelivery app/web.1: module.js:340 
  Jan 11 03:37:47 emaildelivery app/web.1: throw err; 
  Jan 11 03:37:47 emaildelivery app/web.1: ^ 
  Jan 11 03:37:47 emaildelivery app/web.1: Error: Cannot find module './collection/shared' 
  Jan 11 03:37:47 emaildelivery app/web.1: at Function.Module._resolveFilename (module.js:338:15) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Function.Module._load (module.js:280:25) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Module.require (module.js:364:17) 
  Jan 11 03:37:47 emaildelivery app/web.1: at require (module.js:380:17) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Object.&lt;anonymous&gt; (/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:14:14) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Module._compile (module.js:456:26) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Object.Module._extensions..js (module.js:474:10) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Module.load (module.js:356:32) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Function.Module._load (module.js:312:12) 
  Jan 11 03:37:47 emaildelivery app/web.1: at Module.require (module.js:364:17) 
  Jan 11 03:37:48 emaildelivery heroku/web.1: Process exited with status 8 
  Jan 11 03:37:48 emaildelivery heroku/web.1: State changed from starting to crashed 
  Jan 11 04:13:36 emaildelivery heroku/router: at=error code=H10 desc="App crashed" method=GET path=/robots.txt host=emaildelivery.herokuapp.com fwd="66.249.73.12" dyno= connect= service= status=503 bytes= 
  </code></pre>
  
  <p>The strange thing is, the site works fine locally on multiple dev machines. It's just on Heroku that it dies. We've tried upgrading/downgrading the node.js version and the mongoose module version, but can't seem to solve this problem.</p>
  
  <p>Any ideas?</p>