Share feedback, ideas and get community help

Updated 4 months ago

Custom image issues

At a glance

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.

There is no explicitly marke

Useful resources
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: [] }
z
B
l
10 comments
Also when I compile the dockerfile I usually get no such file or directory error on this step in dockerfile:

COPY --from=builder --chown=node:node /app/apps/${SCOPE}/.next/standalone ./
COPY --from=builder --chown=node:node /app/apps/${SCOPE}/.next/static ./apps/${SCOPE}/.next/static
astonishingly server.js does not gets created when i run app using pnpm dev locally
Not builder is failing to compile at all

Dockerfile:36
--------------------
34 |
35 | #COPY --from=builder --chown=node:node /app/apps/${SCOPE}/.next/standalone ./
36 | >>> COPY --from=builder --chown=node:node /app/apps/${SCOPE}/.next/static ./apps/${SCOPE}/.next/static
37 | COPY --from=builder --chown=nextjs:nodejs /app/apps/${SCOPE}/public ./apps/${SCOPE}/public
38 | ## Copy next-runtime-env and its dependencies for runtime public variable injection
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref aaef912f-93b0-4cee-bbf2-1f9579271977::r1ky842nwks8v9pupdkick3be: "/app/apps/builder/.next/static": not found

However I can see that static folder is present in the code
@Baptiste any help on this please
I honestly have no clue πŸ€”
This issue resolved by resolved by removing .next from dockerignore. However server.js file is missing on runtime somehow
The edits you made were in which branch?
I had similar problems but managed to solve them with the main branch
I created my custom branch
Add a reply
Sign up and join the conversation on Discord