After build `dist` not found

I’m running a node server using nestjs.

When I use yarn start, all goes well. But when I use the production build, node ./dist/main it fails.

The build step is working properly, and running locally works fine. I get the error:

Error: Cannot find module ‘/opt/render/project/src/backend/dist/main’

This is the correct path within my project, I’m using rootDir = backend.

Start command: node ./dist/main, I’ve also tried node dist/main.

Could it be that the dist folder isn’t being delivered to the server? Or is the format of my start command off?

Thanks!

Adding more context.

When I SSH to a server I can manually start the server using the yarn prod command

Solved this one in another support channel with @tevonsb directly.

1 Like

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