title: Node Mongodb crash on Heroku while writing to DB
body: <p>I have a pretty straight code that writes one field to a hosted MongoDB, using the standard mongodb module. The application itself is running on Heroku and was working well for almost a year, when I started getting errors on the client side.</p>
  
  <p>I added some console logs, and found 2 errors, coming from my db module:</p>
  
  <p>1.</p>
  
  <pre><code>Failed to load c++ bson extension, using pure JS version
      throw err;
      at Object.Module._extensions..js (module.js:474:10)
      at Object.&lt;anonymous&gt; (/app/node_modules/mongodb/lib/mongodb/collection.js:14:14)
      at Function.Module._load (module.js:280:25)
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>Error: Cannot find module './collection/shared'
      at Function.Module._resolveFilename (module.js:338:15)
  
  module.js:340
      at require (module.js:380:17)
      at Module.require (module.js:364:17)
            ^
      at Module.require (module.js:364:17)
      at Module._compile (module.js:456:26)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      Process exited with status 8
      State changed from up to crashed
  </code></pre>
  
  <p>I cannot replicate those errors on my Mac - everything seems to work fine (accessing the same DB as the one on Heroku). I tried rolling back to mongodb v1.2 - no help, same errors.</p>
  
  <p>Couldn't find anything on the googles or mongodb's JIRA, so I'd appreciate any help. For now, I surrounded the entire call with a try-catch, so it doesn't crash (but still doesn't work).</p>
  
  <p><strong>Update</strong>:<br>
  The try-catch doesn't help - I get the result once, but the app is marked as 'crashed' on Heroku, so I have to restart it manually. Will avoid DB call until issue resolved.</p>