Kane
Kane

Reputation: 909

Node.js mongoose module failing on Heroku

Starting a couple days ago, our site http://emaildelivery.herokuapp.com displays an Application Error:

"An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details."

Our Heroku log shows:

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.<anonymous> (/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= 

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.

Any ideas?

Upvotes: 0

Views: 1637

Answers (1)

Mustafa
Mustafa

Reputation: 10413

Did you try deleting node_modules folder and performing npm install and see the result? This is what Heroku is doing. Maybe you added node_modules to your repository, and it is being uploaded and making it unconsistent.

Upvotes: 2

Related Questions