R
Railway4mo ago
Benrobo

Error: Cannot find module '/app/dist/server.js'

I have the following isolated monorepo structure : /-packages - / api - / app But i'm just trying to deploy the api on railway only,. I've set the root directory to /packages/api/ and start command to node dist/server.js each time it tries redeploying i keep getting the error message in the title above. Any idea how this can be resolved?
3 Replies
Percy
Percy4mo ago
Project ID: f59df6b2-c7e3-42ce-959a-4e436f2c5350
Benrobo
BenroboOP4mo ago
here are the logs, btw, it only crash during deployment and not during build:
Starting Container

container event container died

node:internal/modules/cjs/loader:1189

throw err;

^



Error: Cannot find module '/app/dist/server.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)

at Module._load (node:internal/modules/cjs/loader:1012:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)

at node:internal/main/run_main_module:30:49 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}



Node.js v22.2.0
Starting Container

container event container died

node:internal/modules/cjs/loader:1189

throw err;

^



Error: Cannot find module '/app/dist/server.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)

at Module._load (node:internal/modules/cjs/loader:1012:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)

at node:internal/main/run_main_module:30:49 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}



Node.js v22.2.0
Brody
Brody4mo ago
please open your own thread as for the OP of the thread, I'm going to close it out in favour of your post on the help station, going forward, please do not cross post.
Want results from more Discord servers?
Add your server