Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: yarn/node/vite issue starting up development container #2301

Closed
3 of 5 tasks
jaarasys-henria opened this issue Jan 29, 2024 · 3 comments · Fixed by #2304
Closed
3 of 5 tasks

[Bug]: yarn/node/vite issue starting up development container #2301

jaarasys-henria opened this issue Jan 29, 2024 · 3 comments · Fixed by #2304
Labels
bug Something isn't working

Comments

@jaarasys-henria
Copy link
Contributor

jaarasys-henria commented Jan 29, 2024

Verified issue does not already exist?

  • I have searched and found no existing issue

Is this related to GoCardless, Simplefin or another bank-sync provider?

  • I have checked my server logs and could not see any errors there
  • I will be attaching my server logs to this issue
  • I will be attaching my client-side (browser) logs to this issue
  • I understand that this issue will be automatically closed if insufficient information is provided

What happened?

I meant to continue work on PR #1994, but stumbled upon an issue with the Docker-based development setup.

Using the provided docker-compose.yml I used to be able to spin up a development server without issues by just running docker compose up --build. With current master branch @ commit 43ebe9e there's an error spinning up the container, which I believe originates from yarn attempting to run vite.

Docker version 25.0.1, build 29cf629

Any help would be much appreciated.

What error did you receive?

docker compose up --build
[+] Building 0.0s (7/7) FINISHED                                                                                                                           docker:default
 => [actual-development internal] load build definition from Dockerfile                                                                                              0.0s
 => => transferring dockerfile: 457B                                                                                                                                 0.0s
 => [actual-development internal] load metadata for docker.io/library/node:18-bullseye                                                                               0.0s
 => [actual-development internal] load .dockerignore                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                      0.0s
 => [actual-development 1/3] FROM docker.io/library/node:18-bullseye                                                                                                 0.0s
 => CACHED [actual-development 2/3] RUN apt-get update -y && apt-get upgrade -y && apt-get install -y openssl                                                        0.0s
 => CACHED [actual-development 3/3] WORKDIR /app                                                                                                                     0.0s
 => [actual-development] exporting to image                                                                                                                          0.0s
 => => exporting layers                                                                                                                                              0.0s
 => => writing image sha256:1f3fbe74fddbfb193352ac95bc2d2eaf971c822400126ffd5dd0b0174886a440                                                                         0.0s
 => => naming to docker.io/library/actual-development                                                                                                                0.0s
[+] Running 1/0
 ✔ Container actual-actual-development-1  Created                                                                                                                    0.0s 
Attaching to actual-development-1
actual-development-1  | Usage Error: Couldn't find a script named "webpack".
actual-development-1  | 
actual-development-1  | $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
actual-development-1  | node:events:495
actual-development-1  |       throw er; // Unhandled 'error' event
actual-development-1  |       ^
actual-development-1  | 
actual-development-1  | Error: spawn vite ENOENT
actual-development-1  |     at ChildProcess._handle.onexit (node:internal/child_process:284:19)
actual-development-1  |     at onErrorNT (node:internal/child_process:477:16)
actual-development-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
actual-development-1  | Emitted 'error' event on ChildProcess instance at:
actual-development-1  |     at ChildProcess._handle.onexit (node:internal/child_process:290:12)
actual-development-1  |     at onErrorNT (node:internal/child_process:477:16)
actual-development-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
actual-development-1  |   errno: -2,
actual-development-1  |   code: 'ENOENT',
actual-development-1  |   syscall: 'spawn vite',
actual-development-1  |   path: 'vite',
actual-development-1  |   spawnargs: []
actual-development-1  | }
actual-development-1  | 
actual-development-1  | Node.js v18.18.2
actual-development-1  | ERROR: "start:browser-backend" exited with 1.
actual-development-1 exited with code 1+

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

No response

Operating System

Linux

@jaarasys-henria jaarasys-henria added the bug Something isn't working label Jan 29, 2024
@jaarasys-henria jaarasys-henria changed the title [Bug]: [Bug]: yarn/vite issue starting up development container Jan 29, 2024
@jaarasys-henria jaarasys-henria changed the title [Bug]: yarn/vite issue starting up development container [Bug]: yarn/node/vite issue starting up development container Jan 29, 2024
@jaarasys-henria
Copy link
Contributor Author

This behavior is introduced by d5359a9. Prior commit 3eee0b1 works as before.

@twk3
Copy link
Contributor

twk3 commented Jan 30, 2024

@jaarasys-henria thanks for calling out this workflow. There is a bug here. Fixed by #2304

But from your error you also need to remove your node_modules directory to get the new dependencies. The current docker dev scripts for actual only install the dependencies once, when it sees that directory as empty. So to get ANY new dependencies you currently need to remove that directory to get the dependency install to happen again.

@jaarasys-henria
Copy link
Contributor Author

jaarasys-henria commented Jan 30, 2024

@jaarasys-henria thanks for calling out this workflow. There is a bug here. Fixed by #2304

But from your error you also need to remove your node_modules directory to get the new dependencies. The current docker dev scripts for actual only install the dependencies once, when it sees that directory as empty. So to get ANY new dependencies you currently need to remove that directory to get the dependency install to happen again.

Thanks for the node_modules advice! FWIW confirming that I can run without issues after removing node_modules directory and incorporating the fixes from #2304. Cheers!

Is the node_modules removal advice documented somewhere? If not, it might be a good idea to include it in for example CONTRIBUTING.md for others like me, who wish to contribute, but aren't that well versed in JS tool chain ecosystem.

@twk3 twk3 closed this as completed in #2304 Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants