Devtools looking on the wrong port
It seems that devtools is trying to connect on 5002 yet it launches on 5001. I can't find anywhere to change either one (either where it listens or where it tries to connect to). Has anyone had any luck with devtools?
3 Replies
Hi @oshiri3676. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It appears that there have been some issues with the devtools server in Refine. The server is supposed to run on port 5001, but there have been instances where it tries to connect to port 5002, causing conflicts.
Here are some steps you can try to resolve the issue:
1. Remove the
--devtools
option from the dev command.
2. Before running the dev
script, run npm run refine devtools
. If you don't have the refine
command defined in your package.json#scripts you can add it like "refine": "refine"
.
3. Then run the dev script in a separate tab or terminal.
This was suggested by a trusted support staff in a Discord support thread (https://discord.com/channels/837692625737613362/1159002778845315092).
If you're still facing issues, it might be due to conflicting environment variables, specifically the PORT
variable. A potential workaround for this is to start the devtools
individually without leaving it to the dev
command. This should prevent the PORT
variable from being defined and causing a conflict.
There's also a pull request (https://github.com/refinedev/refine/pull/5056) that was opened to fix this issue, so you might want to keep an eye on that for updates.
If you're trying to run multiple Refine projects simultaneously, you might encounter an error saying that the port is already in use. This is a known issue and has been reported on Github (https://github.com/refinedev/refine/issues/5294). A potential solution is to catch this specific error and trigger the generation of a new port, similar to how Next.js handles it.
If none of these solutions work, you might want to consider temporarily removing the @refinedev/devtools
dependency from your project as suggested in this Github comment (https://github.com/refinedev/refine/issues/5211). This is a temporary solution until a permanent one is implemented.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@783439443410813008> kapa.ai is still learning and improving, please let us know how it did by reacting below
stormy-goldOP•12mo ago
Ok - so it was because I was using one of the ports, so it moved itself forward (from 5001 to 5001). Killing my other usages fixed it..