The community member created an image but is encountering errors on the builder and viewer side, while the non-containerized code seems to be working fine. The errors indicate that the /app/apps/builder/server.js and /app/apps/viewer/server.js files cannot be found. The community member used the same Dockerfile as the one shared in the main repository.
In the comments, other community members suggest that the issue might be related to the Dockerfile, specifically the COPY step. One community member mentions encountering a "no such file or directory" error on a similar COPY step. Another community member notes that the server.js file is not being created when running the app locally using pnpm dev.
The issue was eventually resolved by removing the .next directory from the .dockerignore file. However, the community member still reports that the server.js file is missing at runtime.
The community members discuss their attempts to solve the issue, including reviewing the code in a specific branch and trying to solve the problem using the main branch. One community member created a custom branch to address the issue.
I created my image but it seems to be giving errors on builder and viewer side but my non containerized code seems to be fine and working. I used the same dockerfile that is shared in the main repo. Builder side: Error: Cannot find module '/app/apps/builder/server.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
On viewer side: Error: Cannot find module '/app/apps/viewer/server.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.19.1
- event [next-runtime-env] read environment variables prefixed with 'NEXT_PUBLIC_' from process.env.
- ready [next-runtime-env] wrote browser runtime environment variables to '/app/apps/viewer/public/__ENV.js'.
node:internal/modules/cjs/loader:1137
throw err;
^
Error: Cannot find module '/app/apps/viewer/server.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}