[Bug]: docker does not build properly when developing on Mac #2805

Closed
opened 2026-02-28 20:29:03 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @RMcGhee on GitHub (Jan 11, 2026).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

When developing on a Mac, setting up the development env requires yarn to install various tools for type checking, linting, etc, and if you do that, node_modules is populated at various levels (root, desktop-client, etc). That works ok.

However, when you try to run yarn vrt:docker, the docker build will fail because of the docker compose, which copies everything in the root directory to /app, including the Mac specific node_modules. The fix for this is to delete node_modules at various levels, then rebuild with no cache, but then the next time you try to yarn typecheck on the Mac side, it will fail because it finds the linux version of the node_modules. Going back and forth like this is pretty annoying.

It may be that I'm missing some part of the dev env setup that would ameliorate this issue, but I think we're simply missing a .dockerignore that would prevent the copying of node_modules. I can create the PR for this if it's not the case that I'm missing a step in env setup.

How can we reproduce the issue?

Develop on a Mac. This is likely replicable on a linux distro that's different from the docker container, and windows.
Start with a clean repo and docker env (no docker built yet)
yarn install at the repo root.
test with yarn typecheck.
cd to packages/desktop-client
Try to build and start the docker env (HTTPS=true docker compose up --build).
It should fail with a node_modules error.
Delete node_modules at the repo root.
HTTPS=true docker compose up --build at the repo root.
The docker container builds and runs correctly.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

No response

Operating System

Mac OSX

Originally created by @RMcGhee on GitHub (Jan 11, 2026). ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? When developing on a Mac, setting up the development env requires yarn to install various tools for type checking, linting, etc, and if you do that, node_modules is populated at various levels (root, desktop-client, etc). That works ok. However, when you try to run yarn vrt:docker, the docker build will fail because of the docker compose, which copies everything in the root directory to /app, including the Mac specific node_modules. The fix for this is to delete node_modules at various levels, then rebuild with no cache, but then the next time you try to yarn typecheck on the Mac side, it will fail because it finds the linux version of the node_modules. Going back and forth like this is pretty annoying. It may be that I'm missing some part of the dev env setup that would ameliorate this issue, but I think we're simply missing a .dockerignore that would prevent the copying of node_modules. I can create the PR for this if it's not the case that I'm missing a step in env setup. ### How can we reproduce the issue? Develop on a Mac. This is likely replicable on a linux distro that's different from the docker container, and windows. Start with a clean repo and docker env (no docker built yet) yarn install at the repo root. test with yarn typecheck. cd to packages/desktop-client Try to build and start the docker env (HTTPS=true docker compose up --build). It should fail with a node_modules error. Delete node_modules at the repo root. HTTPS=true docker compose up --build at the repo root. The docker container builds and runs correctly. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? _No response_ ### Operating System Mac OSX
Author
Owner

@MatissJanis commented on GitHub (Jan 11, 2026):

The problem is that you are doing cd packages/someplace to run commands.

Either run the commands available in root or run yarn workspace @actual-app/web run some:child:command

@MatissJanis commented on GitHub (Jan 11, 2026): The problem is that you are doing `cd packages/someplace` to run commands. Either run the commands available in root or run `yarn workspace @actual-app/web run some:child:command`
Author
Owner

@RMcGhee commented on GitHub (Jan 11, 2026):

Appreciate the reply. Following the instructions here https://actualbudget.org/docs/contributing/development-setup/ and here: https://github.com/actualbudget/actual/tree/master/packages/desktop-client#visual-regression

Started over from a clean repo to test your suggestion, without changing directories from the root repo:

git clone https://github.com/actualbudget/actual.git
Cloning into 'actual'...
remote: Enumerating objects: 108590, done.
remote: Counting objects: 100% (742/742), done.
remote: Compressing objects: 100% (395/395), done.
remote: Total 108590 (delta 566), reused 350 (delta 347), pack-reused 107848 (from 3)
Receiving objects: 100% (108590/108590), 473.25 MiB | 94.01 MiB/s, done.
Resolving deltas: 100% (63005/63005), done.
❯ cd actual
❯ yarn install
➤ YN0000: · Yarn 4.10.3
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ peggy is listed by your project with version 5.0.6 (p644fff), which doesn't satisfy what vite-plugin-peggy-loader requests (^1.2.0 || ^3.0.2 || ^4.0.0).
...excess removed
➤ YN0007: │ sharp@npm:0.32.6 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.46.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 36s 965ms
➤ YN0000: · Done with warnings in 37s 920ms
❯ yarn typecheck
🎯 Found 1316 strict files
🎉 All files passed
❯ yarn start
vite v7.2.2 building client environment for development...
✓ 53 modules transformed.
../dist/plugin-sw.js  88.24 kB │ gzip: 20.44 kB │ map: 178.56 kB
✓ built in 90ms

  VITE v7.2.2  ready in 89 ms

  ➜  Local:   http://localhost:3001/
  ➜  Network: http://192.168.0.102:3001/
  ➜  Network: http://192.168.0.99:3001/
  ➜  Network: http://100.82.205.39:3001/
  ➜  press h + enter to show help
vite v7.2.2 building client environment for development...

watching for file changes...

build started...
transforming (1) ../src/server/main.ts[baseline-browser-mapping] The data in this module is over two months old.  To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D`
✓ 1699 modules transformed.
../lib-dist/browser/kcab.worker.dev.js  5,214.65 kB │ gzip: 885.26 kB │ map: 9,658.05 kB
built in 3359ms.
Unknown input options: manualChunks. Allowed options: cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, input, jsx, logLevel, makeAbsoluteExternalsRelative, maxParallelFileOps, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch

PWA v1.1.0
mode      generateSW
precache  1 entries (0.00 KiB)
files generated
  dev-dist/sw.js.map
  dev-dist/sw.js
  dev-dist/sw.js.map
warnings
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/myName/Projects/actual/packages/desktop-client/dev-dist",
  "globPattern": "**/*.{js,css,html,txt,wasm,sql,sqlite,ico,png,woff2,webmanifest}",
  "globIgnores": [
    "**/node_modules/**/*",
    "sw.js",
    "workbox-*.js"
  ]
}

~/Projects/actual master                                                                                                                                                                                                                                                                                                                          ✘ HUP 19s  .common-uv

❯ HTTPS=true docker compose up --build
[+] Building 2.4s (10/10) FINISHED
 => [internal] load local bake definitions                                    0.0s
 => => reading from stdin 558B     0.0s
...excess removed 
 => resolving provenance for metadata file       0.0s
[+] Running 3/3
 ✔ actual-development                     Built         0.0s
 ✔ Network actual_default                 Created               0.0s
 ✔ Container actual-actual-development-1  Created        1.5s
Attaching to actual-development-1
actual-development-1  | /app/node_modules/rollup/dist/native.js:64
actual-development-1  | 		throw new Error(
actual-development-1  | 		      ^
actual-development-1  |
actual-development-1  | Error: Cannot find module @rollup/rollup-linux-arm64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
actual-development-1  |     at requireWithFriendlyError (/app/node_modules/rollup/dist/native.js:64:9)
actual-development-1  |     at Object.<anonymous> (/app/node_modules/rollup/dist/native.js:73:76)
actual-development-1  |     at Module._compile (node:internal/modules/cjs/loader:1706:14)
actual-development-1  |     at Object..js (node:internal/modules/cjs/loader:1839:10)
actual-development-1  |     at Module.load (node:internal/modules/cjs/loader:1441:32)
actual-development-1  |     at Function._load (node:internal/modules/cjs/loader:1263:12)
actual-development-1  |     at TracingChannel.traceSync (node:diagnostics_channel:328:14)
actual-development-1  |     at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
actual-development-1  |     at cjsLoader (node:internal/modules/esm/translators:309:5)
actual-development-1  |     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7) {
actual-development-1  |   [cause]: Error: Cannot find module '@rollup/rollup-linux-arm64-gnu'
actual-development-1  |   Require stack:
actual-development-1  |   - /app/node_modules/rollup/dist/native.js
actual-development-1  |       at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
actual-development-1  |       at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
actual-development-1  |       at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
actual-development-1  |       at Function._load (node:internal/modules/cjs/loader:1192:37)
actual-development-1  |       at TracingChannel.traceSync (node:diagnostics_channel:328:14)
actual-development-1  |       at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
actual-development-1  |       at Module.require (node:internal/modules/cjs/loader:1463:12)
actual-development-1  |       at require (node:internal/modules/helpers:147:16)
actual-development-1  |       at requireWithFriendlyError (/app/node_modules/rollup/dist/native.js:46:10)
actual-development-1  |       at Object.<anonymous> (/app/node_modules/rollup/dist/native.js:73:76) {
actual-development-1  |     code: 'MODULE_NOT_FOUND',
actual-development-1  |     requireStack: [ '/app/node_modules/rollup/dist/native.js' ]
actual-development-1  |   }
actual-development-1  | }
actual-development-1  |
actual-development-1  | Node.js v22.21.1
actual-development-1 exited with code 1

Sorry if I'm missing something obvious, but following the docs as closely as possible, and with your suggestion, I still have this issue. yarn start works fine, but the vrt cannot be done on a local/dev instance as the screenshots have a -darwin suffix on Mac. Only way for me to get the vrt to run correctly is with the docker container.

@RMcGhee commented on GitHub (Jan 11, 2026): Appreciate the reply. Following the instructions here https://actualbudget.org/docs/contributing/development-setup/ and here: https://github.com/actualbudget/actual/tree/master/packages/desktop-client#visual-regression Started over from a clean repo to test your suggestion, without changing directories from the root repo: ``` git clone https://github.com/actualbudget/actual.git Cloning into 'actual'... remote: Enumerating objects: 108590, done. remote: Counting objects: 100% (742/742), done. remote: Compressing objects: 100% (395/395), done. remote: Total 108590 (delta 566), reused 350 (delta 347), pack-reused 107848 (from 3) Receiving objects: 100% (108590/108590), 473.25 MiB | 94.01 MiB/s, done. Resolving deltas: 100% (63005/63005), done. ❯ cd actual ❯ yarn install ➤ YN0000: · Yarn 4.10.3 ➤ YN0000: ┌ Resolution step ➤ YN0000: └ Completed ➤ YN0000: ┌ Post-resolution validation ➤ YN0060: │ peggy is listed by your project with version 5.0.6 (p644fff), which doesn't satisfy what vite-plugin-peggy-loader requests (^1.2.0 || ^3.0.2 || ^4.0.0). ...excess removed ➤ YN0007: │ sharp@npm:0.32.6 must be built because it never has been before or the last one failed ➤ YN0007: │ core-js-pure@npm:3.46.0 must be built because it never has been before or the last one failed ➤ YN0000: └ Completed in 36s 965ms ➤ YN0000: · Done with warnings in 37s 920ms ❯ yarn typecheck 🎯 Found 1316 strict files 🎉 All files passed ❯ yarn start vite v7.2.2 building client environment for development... ✓ 53 modules transformed. ../dist/plugin-sw.js 88.24 kB │ gzip: 20.44 kB │ map: 178.56 kB ✓ built in 90ms VITE v7.2.2 ready in 89 ms ➜ Local: http://localhost:3001/ ➜ Network: http://192.168.0.102:3001/ ➜ Network: http://192.168.0.99:3001/ ➜ Network: http://100.82.205.39:3001/ ➜ press h + enter to show help vite v7.2.2 building client environment for development... watching for file changes... build started... transforming (1) ../src/server/main.ts[baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: `npm i baseline-browser-mapping@latest -D` ✓ 1699 modules transformed. ../lib-dist/browser/kcab.worker.dev.js 5,214.65 kB │ gzip: 885.26 kB │ map: 9,658.05 kB built in 3359ms. Unknown input options: manualChunks. Allowed options: cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, input, jsx, logLevel, makeAbsoluteExternalsRelative, maxParallelFileOps, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch PWA v1.1.0 mode generateSW precache 1 entries (0.00 KiB) files generated dev-dist/sw.js.map dev-dist/sw.js dev-dist/sw.js.map warnings One of the glob patterns doesn't match any files. Please remove or fix the following: { "globDirectory": "/Users/myName/Projects/actual/packages/desktop-client/dev-dist", "globPattern": "**/*.{js,css,html,txt,wasm,sql,sqlite,ico,png,woff2,webmanifest}", "globIgnores": [ "**/node_modules/**/*", "sw.js", "workbox-*.js" ] } ~/Projects/actual master ✘ HUP 19s  .common-uv ❯ HTTPS=true docker compose up --build [+] Building 2.4s (10/10) FINISHED => [internal] load local bake definitions 0.0s => => reading from stdin 558B 0.0s ...excess removed => resolving provenance for metadata file 0.0s [+] Running 3/3 ✔ actual-development Built 0.0s ✔ Network actual_default Created 0.0s ✔ Container actual-actual-development-1 Created 1.5s Attaching to actual-development-1 actual-development-1 | /app/node_modules/rollup/dist/native.js:64 actual-development-1 | throw new Error( actual-development-1 | ^ actual-development-1 | actual-development-1 | Error: Cannot find module @rollup/rollup-linux-arm64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory. actual-development-1 | at requireWithFriendlyError (/app/node_modules/rollup/dist/native.js:64:9) actual-development-1 | at Object.<anonymous> (/app/node_modules/rollup/dist/native.js:73:76) actual-development-1 | at Module._compile (node:internal/modules/cjs/loader:1706:14) actual-development-1 | at Object..js (node:internal/modules/cjs/loader:1839:10) actual-development-1 | at Module.load (node:internal/modules/cjs/loader:1441:32) actual-development-1 | at Function._load (node:internal/modules/cjs/loader:1263:12) actual-development-1 | at TracingChannel.traceSync (node:diagnostics_channel:328:14) actual-development-1 | at wrapModuleLoad (node:internal/modules/cjs/loader:237:24) actual-development-1 | at cjsLoader (node:internal/modules/esm/translators:309:5) actual-development-1 | at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7) { actual-development-1 | [cause]: Error: Cannot find module '@rollup/rollup-linux-arm64-gnu' actual-development-1 | Require stack: actual-development-1 | - /app/node_modules/rollup/dist/native.js actual-development-1 | at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15) actual-development-1 | at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19) actual-development-1 | at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22) actual-development-1 | at Function._load (node:internal/modules/cjs/loader:1192:37) actual-development-1 | at TracingChannel.traceSync (node:diagnostics_channel:328:14) actual-development-1 | at wrapModuleLoad (node:internal/modules/cjs/loader:237:24) actual-development-1 | at Module.require (node:internal/modules/cjs/loader:1463:12) actual-development-1 | at require (node:internal/modules/helpers:147:16) actual-development-1 | at requireWithFriendlyError (/app/node_modules/rollup/dist/native.js:46:10) actual-development-1 | at Object.<anonymous> (/app/node_modules/rollup/dist/native.js:73:76) { actual-development-1 | code: 'MODULE_NOT_FOUND', actual-development-1 | requireStack: [ '/app/node_modules/rollup/dist/native.js' ] actual-development-1 | } actual-development-1 | } actual-development-1 | actual-development-1 | Node.js v22.21.1 actual-development-1 exited with code 1 ``` Sorry if I'm missing something obvious, but following the docs as closely as possible, and with your suggestion, I still have this issue. yarn start works fine, but the vrt cannot be done on a local/dev instance as the screenshots have a -darwin suffix on Mac. Only way for me to get the vrt to run correctly is with the docker container.
Author
Owner

@MatissJanis commented on GitHub (Jan 11, 2026):

Try

"""

HTTPS=true yarn start
yarn vrt:docker
"""

@MatissJanis commented on GitHub (Jan 11, 2026): Try """ HTTPS=true yarn start yarn vrt:docker """
Author
Owner

@RMcGhee commented on GitHub (Jan 11, 2026):

BAM! That's the happy path, thanks.
I was definitely confused about which docker container was being used for what, the VRT docker container is a super lightweight playwright container, and has nothing to do with the dev docker container. I prefer not developing in the dev docker container, so I shouldn't need to go back and forth, thanks!

  • Rich
@RMcGhee commented on GitHub (Jan 11, 2026): BAM! That's the happy path, thanks. I was definitely confused about which docker container was being used for what, the VRT docker container is a super lightweight playwright container, and has nothing to do with the dev docker container. I prefer not developing in the dev docker container, so I shouldn't need to go back and forth, thanks! - Rich
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#2805