Directus (Docker) / NextJS app not deploying successfully

tutmosesTRIAL

10 months ago

Hi, my app is NextJS with a containerized Directus backend. I'm new to web development so I'm struggling with the complexity of these interacting systems. The build seemed to be successful but the deployment failed. Here are the deployment logs:

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/60f4b318-b45a-4759-8c2c-c6d612de9cd8/vol_4de8nmj7hxn32g92

Starting Container

node:internal/modules/cjs/loader:1143

throw err;

^

Error: Cannot find module '/app/cli.js'

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

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

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

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

code: 'MODULENOTFOUND',

requireStack: []

}

Node.js v18.20.2

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/60f4b318-b45a-4759-8c2c-c6d612de9cd8/vol_4de8nmj7hxn32g92

node:internal/modules/cjs/loader:1143

throw err;

^

Error: Cannot find module '/app/cli.js'

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

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

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

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

code: 'MODULENOTFOUND',

requireStack: []

}

Node.js v18.20.2

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/60f4b318-b45a-4759-8c2c-c6d612de9cd8/vol_4de8nmj7hxn32g92

container event container restart

node:internal/modules/cjs/loader:1143

throw err;

^

Error: Cannot find module '/app/cli.js'

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

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

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

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

code: 'MODULENOTFOUND',

requireStack: []

}

Node.js v18.20.2

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/60f4b318-b45a-4759-8c2c-c6d612de9cd8/vol_4de8nmj7hxn32g92

container event container died

node:internal/modules/cjs/loader:1143

throw err;

^

Error: Cannot find module '/app/cli.js'

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

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

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

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

code: 'MODULENOTFOUND',

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

1 Replies

10 months ago

You ran railway up when linked to the Directus service, this uploads the local folder and tries to deploy it.

Please redeploy the first deployment from it's 3 dot menu.

Going forward please be careful what service you railway up into.