How to start servers for two Refine projects
I have two refine React projects and I'm trying to run both local servers concurrently.
But after running the first one then I try to run the second one, I get this error even after changing the port in the
package.json
scripts:
The first server runs on port 5177
while I set the second to 5173
I'm using Yarn
.4 Replies
Hi @script4559. 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 information provided in the extracts, it seems like you're encountering a known issue where trying to run two refine projects simultaneously results in a port conflict error. This issue has been reported on the refine GitHub repository (https://github.com/refinedev/refine/issues/5294).
The error message
Error: listen EADDRINUSE: address already in use :::5002
indicates that the port 5002 is already in use by another process, which in this case is likely the first refine project you started.
Currently, refine does not automatically generate a new port if the default one is in use, unlike some other frameworks like Next.js. The user who reported this issue suggested that refine should catch this specific error and trigger the generation of a new port.
As a workaround, you might want to try manually specifying a different port for the second project. However, it seems like you've already tried this and it didn't work. It's possible that refine is not correctly recognizing the port specified in the package.json
scripts.
Unfortunately, the extracts do not provide a solution to this issue. You might want to follow the GitHub issue for updates or reach out to the refine community for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@584066183989428345> kapa.ai is still learning and improving, please let us know how it did by reacting below
conventional-tanā¢13mo ago
Hey @script4559, sorry for the issue! With the latest release, we've updated
@refinedev/cli
to accept --devtools
option, which can be set to --devtools=false
and prevent devtools servers from starting.
Can you try to update your refine dependencies to @latest
and use refine dev --devtools=false
to start your project?
Let me know if you have any further issues šquickest-silverOPā¢13mo ago
No issues
it works fine now
Thanks G