[GH-ISSUE #7561] [Bug]: Docker local build fails with ERR_MODULE_NOT_FOUND: @actual-app/crdt #44771

Closed
opened 2026-04-26 06:40:22 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @lamelas on GitHub (Apr 20, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/7561

What happened?

When building the Docker image locally using packages/sync-server/docker/ubuntu.Dockerfile or packages/sync-server/docker/alpine.Dockerfile, the container starts but immediately crashes with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@actual-app/crdt' imported from /app/src/app-sync.js

How can we reproduce the issue?

  1. Clone the repository and check out master (after PR #7541 was merged on 2026-04-18)
  2. Build the Docker image using the ubuntu Dockerfile:
    docker build -f packages/sync-server/docker/ubuntu.Dockerfile .
  3. Run the resulting image

Expected: server starts on port 5006
Actual: container exits immediately with ERR_MODULE_NOT_FOUND: Cannot find package '@actual-app/crdt'

Root cause: PR #7541 changed @actual-app/crdt from an external npm package to a workspace:* dependency. This means yarn workspaces focus --production now creates a symlink node_modules/@actual-app/crdt → ../../packages/crdt instead of installing a real directory. The prod stage copies node_modules but never copies packages/crdt, leaving the symlink dangling.

The Dockerfile already handles this for @actual-app/web (removes the symlink and copies build artifacts manually), but was not updated to do the same for @actual-app/crdt.

Fix: in the builder stage, add:
RUN rm -rf ./node_modules/@actual-app/crdt COPY packages/crdt/package.json ./node_modules/@actual-app/crdt/package.json COPY packages/crdt/dist ./node_modules/@actual-app/crdt/dist

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

No response

Operating System

Mac OSX

Originally created by @lamelas on GitHub (Apr 20, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/7561 ### What happened? When building the Docker image locally using `packages/sync-server/docker/ubuntu.Dockerfile` or `packages/sync-server/docker/alpine.Dockerfile`, the container starts but immediately crashes with: `Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@actual-app/crdt' imported from /app/src/app-sync.js` ### How can we reproduce the issue? 1. Clone the repository and check out master (after PR #7541 was merged on 2026-04-18) 2. Build the Docker image using the ubuntu Dockerfile: `docker build -f packages/sync-server/docker/ubuntu.Dockerfile .` 3. Run the resulting image **Expected:** server starts on port 5006 **Actual:** container exits immediately with `ERR_MODULE_NOT_FOUND: Cannot find package '@actual-app/crdt'` **Root cause:** PR #7541 changed `@actual-app/crdt` from an external npm package to a `workspace:*` dependency. This means `yarn workspaces focus --production` now creates a symlink `node_modules/@actual-app/crdt → ../../packages/crdt` instead of installing a real directory. The prod stage copies node_modules but never copies packages/crdt, leaving the symlink dangling. The Dockerfile already handles this for `@actual-app/web` (removes the symlink and copies build artifacts manually), but was not updated to do the same for `@actual-app/crdt`. **Fix:** in the builder stage, add: `RUN rm -rf ./node_modules/@actual-app/crdt COPY packages/crdt/package.json ./node_modules/@actual-app/crdt/package.json COPY packages/crdt/dist ./node_modules/@actual-app/crdt/dist` ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? _No response_ ### Operating System Mac OSX
GiteaMirror added the bug label 2026-04-26 06:40:22 -05:00
Author
Owner

@matt-fidd commented on GitHub (Apr 20, 2026):

cc @MatissJanis

<!-- gh-comment-id:4281237383 --> @matt-fidd commented on GitHub (Apr 20, 2026): cc @MatissJanis
Author
Owner

@lamelas commented on GitHub (Apr 20, 2026):

If this actually needs a fix I have a commit with the needed changes 1dc03b1f3f

<!-- gh-comment-id:4281261910 --> @lamelas commented on GitHub (Apr 20, 2026): If this actually needs a fix I have a commit with the needed changes https://github.com/lamelas/actual/commit/1dc03b1f3f9148b80432109784aed8205b5fab26
Author
Owner

@MatissJanis commented on GitHub (Apr 20, 2026):

https://github.com/actualbudget/actual/pull/7564 should do it.

Did a slightly different fix here because I don't want to keep having this bug report/conversation each time we add a new package and docker breaks again bc we forgot to add some "cp" operation.

<!-- gh-comment-id:4284290534 --> @MatissJanis commented on GitHub (Apr 20, 2026): https://github.com/actualbudget/actual/pull/7564 should do it. Did a slightly different fix here because I don't want to keep having this bug report/conversation each time we add a new package and docker breaks again bc we forgot to add some "cp" operation.
Author
Owner

@lamelas commented on GitHub (Apr 21, 2026):

Awesome, @MatissJanis. Thanks so much!

<!-- gh-comment-id:4287476455 --> @lamelas commented on GitHub (Apr 21, 2026): Awesome, @MatissJanis. Thanks so much!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44771