Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Production deploy with docker image error

default discord avatar
henrikmaa2 years ago
1

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 on GitHub

    Star

    Chat on Discord

    Discord

    online

    Can't find what you're looking for?

    Get dedicated engineering support directly from the Payload team.