Custom image issues
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: []
}
7 Replies
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
Review my code here: https://github.com/mibrahim0499/latest_typebot/tree/latest_commit
GitHub
GitHub - mibrahim0499/latest_typebot
Contribute to mibrahim0499/latest_typebot development by creating an account on GitHub.
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
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