When starting container
node:internal/modules/cjs/loader:958
throw err;
^
Error: Cannot find module '/home/node/app/dist/server.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:955:15)
at Module._load (node:internal/modules/cjs/loader:803:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.8.0
All env variables have been set. This error also occured when trying to execute without docker.
Note to others: This happens if you incorrectly mount volumes from host to container in docker
host_folder/dist : /dist
host_folder/build : /build
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.