Deploy express app

im trying to deploy expressJS app for first time, I have this error:
Error: Cannot find module ‘…/models/BookModel.js’

Mar 21 05:16:07 PMRequire stack:

Mar 21 05:16:07 PM- /opt/render/project/src/src/services/bookManagementService.js

Mar 21 05:16:07 PM- /opt/render/project/src/src/routes/v1.js

Mar 21 05:16:07 PM- /opt/render/project/src/src/app.js

Mar 21 05:16:07 PM

as I can see for some reason its adding extra folders like this one:
Can you please help me? Thank you

this is my folder architecture

also In my local env, everything works just fine, I tried moving the app.js to different folders and stuff but nothing helped. I don’t get what Im doing wrong, maybe there is issue that I see in logs a extra src folder?

  • /opt/render/project/src/src/services/bookManagementService.js

I tried to check if the file was present at the needed location, as you can see on picture it is present but still not working


Render used Linux, which has a case-sensitive filesystem.

Your last screenshot shows the issue:

  • The ls shows the file is called bookModel.js
  • The code error shows you’re referencing it as BookModel.js

That capital B makes all the difference. You’ll need to ensure the casing of files referenced in your code match the name on the filesystem exactly.


Ahh how did I missed that :persevere:

Thanks! it worked, you’re great! :heart:

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