node require bluebird failing
<p>I am running a node.js app and for some reason the node app is failing when requiring the bluebird module <code>require('bluebird')</code>.</p>

<ul>
<li>node version: <code>0.10.40</code></li>
<li>bluebird version: <code>3.3.4</code></li>
</ul>

<p>This is really strange and the only thing I have to go off of is the stack trace here: </p>

<pre><code>TypeError: Cannot call method 'split' of undefined  
    at Object.setBounds (app/node_modules/bluebird/js/release/debuggability.js:614:48)  
    at module.exports (app/node_modules/bluebird/js/release/promise.js:762:11)  
    at Object.&lt;anonymous&gt; (app/node_modules/bluebird/js/release/bluebird.js:9:36)  
    at Module._compile (module.js:456:26)  
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    var firstStackLines = firstLineError.stack.split("\n");
</code></pre>

<p>Again, the app runs just fine. When I add this one line <code>require('bluebird')</code> it crashes and I get this stack trace. Any ideas on what this error is coming from?</p>

<p><strong>[Edit]</strong></p>

<p>at line <code>node_modules/bluebird/js/release/debuggability.js:614:48</code></p>

<pre><code>&gt; console.log(firstLineError);
[Error]
&gt; console.log(firstLineError.message);

&gt; console.log(firstLineError.stack);
undefined
&gt; console.log(firstLineError.toString());
Error: Error
&gt; console.log(firstLineError instanceof Error);
True
</code></pre>

<p>It is an Error object that is essentially empty</p>

<p><strong>temporary solution</strong></p>

<p>When I change the line <code>node_modules/bluebird/js/release/debuggability.js:614</code> to</p>

<pre><code>var firstStackLines = (firstLineError.stack) ? firstLineError.stack.split("\n") : ""; 
</code></pre>

<p>and line 615 to </p>

<pre><code>var lastStackLines = (lastLineError.stack) ? lastLineError.stack.split("\n") : "";
</code></pre>

<p>it works just fine. Not sure if this has lasting effects though</p>