Dom Barker
Dom Barker

Reputation: 1918

Error: Cannot find module, but only on Heroku

My application runs just fine locally, and on a Travis CI build server but when its on Heroku

I get Error: Cannot find module and the app crashes.

Some facts about the npm module

Edit:

It seems that Heroku is erroneously removing my module after the build

-----> Pruning unused dependencies
   unbuild [email protected]
-----> Caching node_modules directory for future builds

Upvotes: 1

Views: 1303

Answers (1)

Dom Barker
Dom Barker

Reputation: 1918

It turns out this was due to my local dev machine (OSX) not being fussy about the casing of file paths whereas Heroku (linux) is.

My module was installed to node_modules/mymodule instead of node_modules/myModule as it should have been.

Upvotes: 4

Related Questions