Deployment Issue from Express/MongoDB app

I’ve got a simple Express/MongoDB app I’m trying to deploy, but whenever I try to deploy, it builds successfully and then fails with ‘Error: Cannot find module ‘…/Config/connection’’ in my index.js file. But from that file, ‘…/Config/connection’ is the correct file path. Not sure what the issue is.

Any thoughts?

Hi!

Please add file extension to the import and try then:
require(“…/Config/connection.js”);

Same issue, unfortunately!

Hi,

I’ve replied to the ticket you also opened, but for completeness I’ll add the same repsonse here:

This is likely a file-casing issue. Linux filesystems are case-senstive, so if your seeing …/Config/connection but the connection.js file is actually named Connection.js (capital C), it wouldn’t be found. You’ll need to check the paths and casing matches exactly between your code and the filesystem.

Hope that helps

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.