WASP App Wont Load Without Restarting Computer
My WASP App will load properly the first run, but it will not run no matter what i do the second time.
So lets say i turn on my Macbook (m2 chip), I go to my wasp app, i wasp start db and wasp start. Everything opens great, app works.
But if i save a change, or CTRL + C the terminal that started the app, no matter what (i close vscode, i wasp clean, etc). The app will NOT load again.
Like it looks like its loading fine in the terminal.
The online app link will work, but the local app link just endless load on any browser.
Is my app getting too big ? Not sure what to do.
Oh but if i restart my computer it works again just the one time
18 Replies
Hi @Zuck. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It seems like you're experiencing an issue where your Wasp app doesn't reload properly after making changes or stopping the process. This issue has been reported by other users as well, and it seems to be related to the connection with the database not being properly re-established after the app restarts.
Here are some steps you can try:
1. Ensure Docker is installed and running. You can check this by running
docker -v
and docker info
in your terminal. Docker is used to start a PostgreSQL database in a container for your Wasp app.
2. Check if something else is running on port 5432
, which is the default port used by PostgreSQL. If this port is occupied by another process, it could prevent your Wasp app from connecting to the database.
3. Try running wasp clean
to remove all generated code and other cached artifacts. This command also deletes the SQLite database if you're using SQLite.
4. If none of the above steps work, you might want to consider creating a new Wasp project and copying your code over to see if the issue persists.
If the problem continues, it would be helpful to share the output of the commands you run and any error messages you see. This could provide more clues about what's going wrong.
For more detailed assistance, consider opening an issue on the Wasp Github page (https://github.com/wasp-lang/wasp/issues). The Wasp team and community are quite active there and might be able to provide more specific help.
Sources:
- Discord support thread: Schedule email with sendgrid > Answers Part 3 (https://discord.com/channels/686873244791210014/1179895919471247490)
- Github Issue (open): Pg-boss connection is having hard time establishing itself after app restart > Original post Part 1 (https://github.com/wasp-lang/wasp/issues/1605)
- Docs > General > CLI Reference > Commands > Project Commands Part 1 (https://wasp-lang.dev/docs/general/cli#project-commands)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?@kapa.ai No restarting the database doesnt do anything, closing docker re-opening docker doesnt do anything either
Let me check the knowledge base for you. One moment! :books:
----------------------
I'm sorry to hear that restarting the database and Docker didn't resolve the issue. This seems to be a more complex problem that might be related to the specific setup of your system or the state of your Wasp project.
Here are a few more things you could try:
1. Check if there are any lingering Docker processes related to your Wasp project that might be causing conflicts. You can list all running Docker containers with the command
docker ps
.
2. Try to create a new Wasp project with wasp new
and see if you encounter the same issue. If the new project works fine, the issue might be specific to your current project.
3. If you're comfortable with it, you could try to debug the issue by inspecting the network traffic between your app and the database. Tools like Wireshark can help with this.
If none of these steps help, I would recommend reaching out to the Wasp community for more specific assistance. You can do this by opening an issue on the Wasp Github page (https://github.com/wasp-lang/wasp/issues) or joining the discussion on the Wasp Discord server (https://discord.com/channels/686873244791210014/1179895919471247490).
Sources:
- Discord support thread: Schedule email with sendgrid > Answers Part 4 (https://discord.com/channels/686873244791210014/1179895919471247490)
- Github Issue (open): Pg-boss connection is having hard time establishing itself after app restart > Original post Part 1 (https://github.com/wasp-lang/wasp/issues/1605)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?Ah okay i think its solved, i think it was because i had a redis server running
@kapa.ai hmm nevermind it stopped working again. Whats the command to check what ports are being used? would that be it?
Let me check the knowledge base for you. One moment! :books:
----------------------
Yes, checking which ports are being used could help identify if there's a conflict that's preventing your Wasp app from running correctly.
On a Unix-based system like macOS, you can use the
lsof
command to check which processes are using a specific port. For example, to check what's running on port 3000, you would run:
You can replace 3000
with any other port number you want to check. If this command returns any output, it means that there's a process running on that port.
For Wasp, you might want to check ports 3000
and 3001
, as these are the default ports used by Wasp for the frontend and backend servers, respectively.
Sources:
- Discord support thread: "wasp start db" takes too much time. > Answers Part 1 (https://discord.com/channels/686873244791210014/1223569423177089093)
- Discord support thread: Schedule email with sendgrid > Answers Part 10 (https://discord.com/channels/686873244791210014/1179895919471247490)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?@kapa.ai i got this:
(env) jacobferrari@Go-Laptop app % lsof -i tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.apple 2813 jacobferrari 16u IPv4 0xd170b6bac663c21f 0t0 TCP localhost:50868->localhost:hbci (ESTABLISHED)
Google 3250 jacobferrari 38u IPv4 0x6252aacbad777cb 0t0 TCP localhost:51117->localhost:hbci (ESTABLISHED)
Cursor 4694 jacobferrari 49u IPv4 0x850bab61dcd00540 0t0 TCP localhost:hbci (LISTEN)
Cursor 4694 jacobferrari 50u IPv4 0x9eaf40a9d0bfb7c5 0t0 TCP localhost:hbci->localhost:50868 (ESTABLISHED)
Cursor 4694 jacobferrari 51u IPv4 0xd0f1efd34f85cf6f 0t0 TCP localhost:hbci->localhost:51117 (ESTABLISHED)
Let me check the knowledge base for you. One moment! :books:
----------------------
From the output you've shared, it appears that there are several processes using port 3000 on your system. The
lsof
command shows that the processes with the names com.apple
, Google
, and Cursor
are all using port 3000 (localhost:hbci
corresponds to localhost:3000
).
This could potentially be causing conflicts when you try to run your Wasp app, as Wasp also tries to use port 3000 by default.
Here are a few steps you can take:
1. Try stopping these processes if they are not necessary. You can do this by using the kill
command followed by the PID of the process. For example, to stop the Cursor
process, you would run kill 4694
.
2. If you're unable to stop these processes or they are necessary for other tasks, you can try changing the ports that your Wasp app uses. There's an open issue on the Wasp Github page about making it easy to use different ports (https://github.com/wasp-lang/wasp/issues/730) during Wasp development. The proposed solutions include allowing users to manually specify different ports or having Wasp automatically search for open ports.
Please note that changing the ports used by your Wasp app might require changes to your project's configuration and code.
Sources:
- Discord support thread: "wasp start db" takes too much time. > Answers Part 1 (https://discord.com/channels/686873244791210014/1223569423177089093)
- Github Issue (open): Make it easy to use different ports (than 3000 and 3001) during Wasp development > Original post (https://github.com/wasp-lang/wasp/issues/730)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?@kapa.ai whats the exact kill commands to kill everything that uses port 3000 and 3001
Let me check the knowledge base for you. One moment! :books:
----------------------
To kill all processes using a specific port, you can use the
lsof
command to find the processes and then the kill
command to stop them. Here are the commands you would use to kill all processes using ports 3000 and 3001:
These commands work as follows:
- lsof -t -i:3000
lists the PIDs of all processes using port 3000.
- kill -9
sends the SIGKILL
signal to each of these processes, which forces them to terminate immediately.
Please note that you might need to run these commands with sudo
if the processes were started with higher privileges.
Sources:
- Github Issue (closed): Process is already running on port 3000 > Comments Part 1 (https://github.com/wasp-lang/wasp/issues/198)
- Discord support thread: nothing shows up in localhost:3000 after wasp start > Answers Part 1 (https://discord.com/channels/686873244791210014/1213958217537814640)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?@kapa.ai FIXED :godfatherboi:
Let me check the knowledge base for you. One moment! :books:
----------------------
I'm glad to hear that your issue is resolved! If you have any more questions or run into any other issues with Wasp, feel free to ask. Happy coding!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?
@kapa.ai oh last thing because im lazy to look it up, how can i change my wasp app to use a different front end port rather than 3000
Let me check the knowledge base for you. One moment! :books:
----------------------
To change the port that your Wasp app's frontend uses, you can customize the Vite configuration. Here's how you can do it:
1. Create a
vite.config.js
file in your Wasp project's root directory with the following content:
2. Update the WASP_WEB_CLIENT_URL
environment variable in your .env.server
file to reflect the new port:
Please note that you need to be careful when changing the dev server port, as it could cause conflicts if the port is already in use by another process.
Sources:
- Docs > Project > Custom Vite Config > Examples > Custom Dev Server Port (https://wasp-lang.dev/docs/project/custom-vite-config#examples)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?@kapa.ai i love you
Let me check the knowledge base for you. One moment! :books:
----------------------
As an AI, I don't have feelings, but I'm here to help you to the best of my ability! If you have any more questions about Wasp or anything else, feel free to ask.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, 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?
Hey @Zuck, I see everything is under control 😄
If you need a human to jump in, let me know!
@sodic I’ll let you know, it’s still being weird but I think it has to do with something with the ports being used. Sometimes it’s good sometimes it isn’t, sometimes I have to change the port in vite a few times.
But I’ll let you know if it becomes really worrisome
@Zuck what was the cause at the end, I get that it is not 100% clear, but seems you are suspecting ports being taken? Do you have a good idea of what helped fix it?