Note that there are some explanatory texts on larger screens.

plurals
  1. POError 500 when not including the node_modules folder
    primarykey
    data
    text
    <p><strong>LAST UPDATE</strong></p> <p>It appeared that one my dependencies, not yet 1.0, changed its API between 2 versions. My local version was outdated, and when pushing to Heroku, Heroku downloaded the latest version, with the API change that crashed my app.</p> <p><strong>CONCLUSION</strong> : When using libraries not stable yet (that didn't reach 1.0), stick to a specific version.</p> <p>Thank you guys for trying to help me.</p> <p>=================</p> <p>Using Node 0.8.latest, express 3.latest. </p> <p>One of my route works perfectly locally, but gives me a 500 error when the app is deployed. The error message is very app-specific, but illogic. It's a TypeError, telling me that something (that should be defined) is undefined. To make it work, the only weird solution I found was to remove <code>node_modules</code> from .gitignore and tracking it under git. When pushed on heroku, no error appears and the url just works</p> <p>It starts to get strange when you know that I DID NOT change any code inside of the node_modules folder. I also compared locally and "heroku"ly installed dependencies by comparing a local <code>npm ls</code> to the list of modules produced when pushing to heroku, since it rebuilds the dependencies because they're <code>.gitignore</code>'d. I see minor but inexplicable differences on a few packages noted <code>invalid</code> with <code>npm ls</code>. None of this package is in my <code>package.json</code> file, they're dependencies for my package in <code>package.json</code>. Namely, <code>connect</code> is 2.4.4 locally and 2.5.0 on heroku, <code>send</code> is 0.0.4 locally and 0.1.0 on heroku, <code>emitter-compnonent</code> is 0.0.1 locally and 0.0.5 on heroku. The rest is striclty identical.</p> <p>The other thing to note is that the error stacktrace points a module which has identical versions on both environments and which doesn't depend on nor isn't a dependency for the modules that have different versions. So even the minor dependency differences shouldn't be the cause of the problem.</p> <p>But then, I can't see where does the problem come from, and I would like to avoid tracking my <code>node_modules</code> files. Or should I ?</p> <p><strong>UPDATE</strong></p> <p>Here's my package.json file as per request by Hector Correa</p> <pre><code>{ "name": "myapp", "version": "0.1.0", "dependencies": { "express": "3.0.x", "mongoose": "3.0.x", "superagent": "0.9.x", "oauth": "0.9.x", "querystring": "0.1.x", "consolidate": "~0.4.0", "mustache": "~0.6.0", "singly": "*", "underscore": "~1.4.1" }, "devDependencies": { "mocha": "1.4.x", "supertest": "0.1.x" }, "engines": { "node": "0.8.x", "npm": "1.1.x" } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload