Bug?: `wasp start` reinstalls dependencies after stopping
When I make a change with wasp and everything is OK, it immediately recompiles without any problem.
When I make a change and something is wrong, it gives me the error, I fix it and it recompiles again without any problem.
The problem is when it tries to compile something that is wrong, so it gives me back correctly an:
β --- [Error] Recompilation on file change failed.: ------------------------------
1 errors found.
β --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 2
But it immediately starts to recompile:
β --- [Error] Recompilation on file change failed.: ------------------------------
1 errors found
β --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 2
π --- Recompiling on file change... ----------------------------------------------
Then I stopped the process and used wasp start
again. And it started to install all dependencies (still going on):
β --- [Error] Recompilation on file change failed.: ------------------------------
1 errors found
β --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 2
π --- Recompiling on file change... ----------------------------------------------
^C
rootall@Nerox-LpTp:~/apps/minisaas-boilerplate/app$ wasp start
π --- Starting compilation and setup phase. Hold tight... ------------------------
π --- Compiling wasp project... --------------------------------------------------
[ Wasp ] Starting npm install
[ Wasp ]
[ Wasp ] added 1 package, and audited 844 packages in 3s
[ Wasp ]
[ Wasp ] 140 packages are looking for funding
[ Wasp ] run
npm fund for details
[ Wasp ]
[ Wasp ] 9 vulnerabilities (2 low, 3 moderate, 4 high)
[ Wasp ]
[ Wasp ] To address issues that do not require attention, run:
[ Wasp ] npm audit fix
[ Wasp ]
[ Wasp ] To address all issues (including breaking changes), run:
[ Wasp ] npm audit fix --force
[ Wasp ]
[ Wasp ] Run
npm audit for details.
[ Client ] Starting npm install
[ Server ] Starting npm install
[ Server ] Still installing npm dependencies!
[ Client ] Still installing npm dependencies!
[ Server ] Installation going great - we'll get there soon!
[ Client ] Installation going great - we'll get there soon!
[ Server ] The installation is taking a while, but we'll get there!
[ Client ] The installation is taking a while, but we'll get there!
[ Client ] Yup, still not done installing.
[ Server ] Yup, still not done installing.
[ Server ] We're getting closer and closer, everything will be installed soon!
[ Client ] We're getting closer and closer, everything will be installed soon!
This only ever happens to me exactly in this scenario (I try to avoid stopping the process at that point), but why does it happen? If everything is installed, why does it take the same time as if I install everything again?6 Replies
Hi @NEROX. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, it seems like the issue you're experiencing might be related to how Wasp handles dependencies. When you run
wasp start
, it starts the compilation and setup phase, which includes installing dependencies. If you stop the process and start it again, it might trigger the installation of dependencies again, even if they are already installed.
This behavior is discussed in a Github issue (https://github.com/wasp-lang/wasp/issues/269) where the Wasp team is considering implementing a feature to warn the user to restart wasp start
or have wasp start
run npm install
automatically when a dependency is added. The idea is to track the dependencies used during the last install and only proceed with the setup if the current dependencies are different or missing. This could potentially avoid unnecessary re-installation of dependencies.
However, this feature doesn't seem to be implemented yet, and it might not cover the exact scenario you're experiencing. It's recommended to report this issue to the Wasp team for further investigation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @NEROX, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Again, I hadn't even noticed it was compiling when I stopped it.
It has just happened again, I have tried to stop and start again, and this time it is true that it does not install everything again (it goes a little faster).
Hey @NEROX thanks for sharing this!
Ok, hm, let's make sure I understood it correctly.
So what is the main issue? That it does npm install if you start it again, even though everything should already be installed?
And you said you can trigger this by introducing an error, stopping it during recompiling, and starting
wasp start
again?
It would be best if we can replicate it on our side, but for that we need exact steps that will cause this error. What if you take a new Wasp app, let's say you create one with wasp new TestBasicApp -t basic
, could you easily get this happening there and then let us know exactly how you did it (how to introduce the error, and what then)?https://www.loom.com/share/aed9951654b742f098d7a750839a81ab a smol hack (?)
I recorded it now because I already upgraded to 0.15.0 and I just installed the SaaS template by default
Loom
Troubleshooting npm Installations
Hey Martin, in this video, I share a hack to bypass long npm installations by using a specific method during deployment. I demonstrate how to speed up the process significantly, potentially saving 15-20 minutes. Watch me bypass the installation process and get straight to deployment.