I’m deploying a nodejs application.
In Build Command, I’m running yarn install && yarn build
which produces node_modules
and dist
directories. In Start Command, I’m running node ./dist/index.js
, which fails because there’s no dist
directory found.
It seems the dist
folder is not uploaded on a build step, since I can’t see neither it nor node_modules
when I’m logging into a container via shell.
I’m wondering what might be the root cause of that.
Deploy logs:
Sep 22 03:20:44 PM ==> Uploading build...
Sep 22 03:21:15 PM ==> Build uploaded in 13s
Sep 22 03:21:15 PM ==> Build successful 🎉
Sep 22 03:21:15 PM ==> Deploying...
Sep 22 03:22:11 PM ==> Detected Node version 16.17.0
Sep 22 03:22:11 PM ==> Starting service with 'yarn serve'
Sep 22 03:22:12 PM yarn run v1.22.5
Sep 22 03:22:12 PM $ node ./dist/index.js
Sep 22 03:22:12 PM node:internal/modules/cjs/loader:959
Sep 22 03:22:12 PM throw err;
Sep 22 03:22:12 PM ^
Sep 22 03:22:12 PM
Sep 22 03:22:12 PM Error: Cannot find module '/opt/render/project/src/dist/index.js'