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

WebSocket server error: Port is already in use #72

Closed
alec-c4 opened this issue May 16, 2023 · 3 comments · Fixed by #93
Closed

WebSocket server error: Port is already in use #72

alec-c4 opened this issue May 16, 2023 · 3 comments · Fixed by #93

Comments

@alec-c4
Copy link

alec-c4 commented May 16, 2023

Hi!
Thanks a lot for your work! But I meet strange behavior for a new app - when I start the app, I see message WebSocket server error: Port is already in use. What's wrong?

It looks like there is a conflict between astro check --watch and astro dev - when I run those commands separately, I see no error message

@jvtrigueros
Copy link

jvtrigueros commented Jun 10, 2023

Nevermind, this blocks astro dev from running.


I believe it's an issue in this line

    "dev": "astro check --watch & astro dev",

Instead of one ampersand(&) it should be two (&&)

    "dev": "astro check --watch && astro dev",

@Brodypen
Copy link

Brodypen commented Jul 4, 2023

Hi, I looked into this a bit and this doesn't work on my end.
I found that this line of code was from this blogpost
From what I understand, the one ampersand symbol (&) will run the two commands in parallel in which they will use the same port.

I'll update this if I find any information that can get rid of error.


EDIT: Just saw the edit above. Selective reading is an issue :/

@satnaing
Copy link
Owner

I found the cause of this problem and it is related to the commit 4fe5084.
Turns out, for some reason, if I add site URL from src/config.ts, "Port is already in use" problem occurs. I'm not really sure why tho. It seems like there might be an unexpected interaction or conflict with the way the site URL is configured.

I'll make a commit to resolve this issue.

Thanks everyone. ✌🏻

satnaing added a commit that referenced this issue Jul 20, 2023
Using SITE.website in astro.config.mjs causes the problem . Thus, change back to the original url string in site value of .

Closes: #72
satnaing added a commit that referenced this issue Jul 20, 2023
Using SITE.website in astro.config.mjs causes the problem . Thus, change back to the original url string in site value of .

Closes: #72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants