nelsontkq / dotnet-svelte-template

a Svelte template using the latest .net core and hot reloading
MIT License
5 stars 0 forks source link

Port <launchSettings https PORT> is already in use #2

Closed Gildedter closed 2 years ago

Gildedter commented 2 years ago

I have it set up as my start up project, and every time I try and run it, it just gives this error:

> svelte-app@1.0.0 dev
> svelte-kit dev

> Port 7288 is already in use
    at Server.onError (PROJECT_PATH\node_modules\vite\dist\node\chunks\dep-ff3ab196.js:45083:28)
    at Server.emit (node:events:527:28)
    at emitErrorNT (node:net:1399:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

changing the port provided on applicatioUrl just updates the error

Edit 1: Its also giving me this other error:

 Microsoft.Hosting.Lifetime[0]
      Content root path: PROJECT_PATH
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
      Couldn't start the SPA development server with command 'npm run dev'.
fail: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
      Couldn't start the SPA development server with command 'npm run dev'.

all of these only when running through visual studio 2022, works without issues on vscode

nelsontkq commented 2 years ago

Since 7288 isn't one of the referenced ports in the launchSettings.json file it's likely that you still had one or more applications open using that port and the default port, or you set the ASPNETCORE_URLS environment variable to one already in use. You can check ports that are in use with netstat -a