Error: Cannot find module '/opt/render/project/src/dist/src/app.js'

I did received this kind of error. “Error: Cannot find module ‘/opt/render/project/src/dist/src/app.js’”.

This works perfectly fine on my local machine. I’m a bit confused as to why is it saying this kind of error when my dist folder is on the root directory after building the project.

Can someone please walk me through this issue?

Hey Sean,

We don’t deploy from the root directory of the filesystem but from “~/project/src”, perhaps your “dist” directory is in the wrong place?

Jérémy.
Render Support, UTC+3

1 Like

When I build it I should expect the dist folder to be on the root directory of my project and it now makes sense with your reply. Thanks.

However, I wonder why it is still generating this error even though the build was successful?

Nvm I got it all working right now. The issue was on one of my files. Thank you again!

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