Closed zeshhaan closed 2 years ago
Hello there!
I'm not sure how can we do that, but we could at least ensure that the error is readable
in the meantime, you can change your server port in perla.jsonc
{
"$schema": "https://raw.githubusercontent.com/AngelMunoz/Perla/main/perla.schema.json",
"index": "./index.html",
"devServer": {
"port": 3000 // <- right here
... content ...
},
"build": { ... content ... },
"packages": { ... content ...}
}
thanks for reporting it
Thank you! I will check that way out next time.
Vite and other similar tools has this out of the box so i thought this might be a "good to have" sometime in the future.
Yes, this sounds completely reasonable I will keep this one open
I've been playing with this looks like this might be the way to do it
#!/usr/bin/env -S dotnet fsi
open System.Net
open System.Net.NetworkInformation
let props = IPGlobalProperties.GetIPGlobalProperties()
let listeners = props.GetActiveTcpListeners()
let findByPortAndAddress (address: string) (port: int) (listener: IPEndPoint) =
let (didParse, address) = IPEndPoint.TryParse($"{address}:{port}")
if didParse then
listener.Address = address.Address
&& address.Port = listener.Port
else
false
let found =
listeners
|> Array.tryFind (findByPortAndAddress "127.0.0.1" 7331)
printfn "Found: %A" found
We would only need to put this detection code before the server is configured, would you be interested in trying to implement it?
otherwise let me know :) and I'll go for it
Great news!
I would like to check this for myself but i fear i wouldn't have the time until the weekend. I would recommend you to go for it.
This is out in v0.16.0
Consider this feature request coming from an early-stage dev so i don't have much knowledge in configuring ports manually 😅
Is your feature request related to a problem? Please describe. I was wondering why the server didn't spin up, then realised that i have been running one on the same port address 💡
Describe the solution you'd like Ability to detect if an address is already in use and if then automatically fallback to a different address to spin up the dev server.
Describe alternatives you've considered Quit current server, run the other one, quit that one, run the first one.
Additional context
This is the message that is being logged when i run
dotnet run --project ../Perla -- serve