openclaw - ✅(Solved) Fix Dockerfile: WhatsApp extension fails — missing src/ and apps/ in runtime image [3 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#49498Fetched 2026-04-08 00:54:37
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
cross-referenced ×3commented ×2referenced ×2

The WhatsApp extension fails at runtime because it references files in src/ and apps/ directories, but the final Docker stage does not COPY these from the build stage.

Error Message

Cannot find module '../../../src/channels/plugins/account-helpers.js'

Followed by:

Cannot find module '../../apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json'

Root Cause

The runtime-assets stage in the Dockerfile copies extensions/ but not src/ or apps/. The WhatsApp extension (and possibly others) has runtime imports that reach back into these directories via relative paths.

Fix Action

Workaround

Adding two lines after the COPY extensions line in the Dockerfile:

COPY --from=runtime-assets --chown=node:node /app/src ./src
COPY --from=runtime-assets --chown=node:node /app/apps ./apps

PR fix notes

PR #49621: fix(docker): copy src/ and apps/ to runtime image for WhatsApp extension

Description (problem / solution / changelog)

Summary

  • Add COPY lines for src/ and apps/ directories in the Dockerfile runtime stage
  • The WhatsApp extension (and potentially others) has runtime imports that reach into src/ and apps/ via relative paths (e.g. ../../../src/channels/plugins/account-helpers.js, ../../apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json)
  • These directories were missing from the final Docker image, causing Cannot find module errors at runtime

Test plan

  • Build Docker image: docker build .
  • Run container with WhatsApp extension enabled and verify no module-not-found errors for src/ or apps/ paths
  • Verify other extensions that may reference src/ or apps/ also work correctly

Fixes #49498

🤖 Generated with Claude Code

Changed files

  • Dockerfile (modified, +2/-0)

PR #49632: fix(docker): copy src/ and apps/ to runtime image for WhatsApp extension

Description (problem / solution / changelog)

Summary

  • Add COPY lines for src/ and apps/ directories in the Dockerfile runtime stage
  • The WhatsApp extension has runtime imports reaching into src/ and apps/ via relative paths
  • These directories were missing from the final Docker stage, causing module not found errors

Test plan

  • Build Docker image and verify WhatsApp extension starts successfully
  • Verify src/channels/plugins/account-helpers.js and tool-display.json are accessible

Fixes #49498

🤖 Generated with Claude Code

Changed files

  • Dockerfile (modified, +2/-0)

PR #49680: fix(docker): include source runtime assets for bundled plugins

Description (problem / solution / changelog)

Summary\n- fix the Docker runtime image to keep bundled source plugins working by copying /app/src into the final image\n- copy the shared ool-display.json resource needed by src/agents/tool-display.ts without pulling in the full pps/ tree\n- add regression coverage in src/dockerfile.test.ts for both runtime asset copies\n\nFixes #49498.\n\n## Why\nSome bundled source plugins still import OpenClaw internals at runtime. In the current tree that includes paths like:\n- extensions/llm-task/src/llm-task-tool.ts -> ../../../src/agents/pi-embedded-runner.js\n- extensions/zalo/src/monitor.webhook.ts -> ../../../src/gateway/net.js\n\nThose source paths were missing from the runtime image. src/agents/tool-display.ts also loads the shared pps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json asset, so the runtime image needs that file as well.\n\n## Testing\n- corepack pnpm exec vitest run src/dockerfile.test.ts\n- corepack pnpm exec vitest run src/agents/tool-display.test.ts\n\nAI-assisted: Codex

Changed files

  • Dockerfile (modified, +2/-0)
  • src/dockerfile.test.ts (modified, +4/-0)

Code Example

Cannot find module '../../../src/channels/plugins/account-helpers.js'

---

Cannot find module '../../apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json'

---

COPY --from=runtime-assets --chown=node:node /app/src ./src
COPY --from=runtime-assets --chown=node:node /app/apps ./apps
RAW_BUFFERClick to expand / collapse

Summary

The WhatsApp extension fails at runtime because it references files in src/ and apps/ directories, but the final Docker stage does not COPY these from the build stage.

Error

Cannot find module '../../../src/channels/plugins/account-helpers.js'

Followed by:

Cannot find module '../../apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json'

Root Cause

The runtime-assets stage in the Dockerfile copies extensions/ but not src/ or apps/. The WhatsApp extension (and possibly others) has runtime imports that reach back into these directories via relative paths.

Workaround

Adding two lines after the COPY extensions line in the Dockerfile:

COPY --from=runtime-assets --chown=node:node /app/src ./src
COPY --from=runtime-assets --chown=node:node /app/apps ./apps

Expected Fix

Either:

  1. Add these COPY lines to the upstream Dockerfile, or
  2. Refactor extensions to not reference src/ and apps/ at runtime (bundle what they need into dist/ or extensions/)

Environment

  • OpenClaw v2026.3.14
  • Docker build from source
  • WhatsApp extension enabled

extent analysis

Fix Plan

To resolve the issue, you can either update the Dockerfile or refactor the extensions. Here are the steps for both approaches:

Approach 1: Update Dockerfile

  • Add the following lines after the COPY extensions/ line in the Dockerfile:
COPY --from=runtime-assets --chown=node:node /app/src ./src
COPY --from=runtime-assets --chown=node:node /app/apps ./apps
  • Rebuild the Docker image

Approach 2: Refactor Extensions

  • Identify the files referenced by the WhatsApp extension at runtime (e.g., account-helpers.js, tool-display.json)
  • Bundle these files into the dist/ or extensions/ directory
  • Update the extension code to use the bundled files instead of referencing src/ and apps/ directories

Verification

  • Rebuild the Docker image and run the container
  • Verify that the WhatsApp extension loads without errors
  • Check the container logs for any issues related to file not found or module not found

Extra Tips

  • Consider using a build tool like Webpack or Rollup to bundle the extension code and dependencies
  • Use absolute paths or environment variables to reference files instead of relative paths
  • Review the extension code for any other potential issues related to file references or dependencies

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Dockerfile: WhatsApp extension fails — missing src/ and apps/ in runtime image [3 pull requests, 2 comments, 3 participants]