question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`svelte-kit dev` does not recognize occupied ports on Windows

See original GitHub issue

Describe the bug When running svelte-kit dev, on Windows, SvelteKit does not throw an error for an already occupied port. Instead what happens is SvelteKit prints the “welcome” message, when trying to reach the started dev server it is of course shadowed by the process already occupying that port.

To Reproduce

On a Windows machine:

  1. Make sure some service is running on port 3000.
  2. Make a new directory and cd into it.
  3. npm init svelte@next
  4. npm i
  5. npm run dev ⬅ This should throw, but doesn’t!

Expected behavior

An error should be thrown to indicate that the port the dev server is trying to launch on is already in use by another process.

Information about your SvelteKit Installation:

Diagnostics
  • The output of npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
  System:
    OS: Windows 10 10.0.19042
    CPU: (4) x64 Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz 
    Memory: 16.23 GB / 23.92 GB
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE      
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD        
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD        
  Browsers:
    Chrome: 89.0.4389.114
    Edge: Spartan (44.19041.423.0), Chromium (89.0.774.75)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.71
    svelte: ^3.29.0 => 3.37.0
    vite: ^2.1.0 => 2.1.5

Severity

Mildly annoying, but for many users nonetheless.

Additional context I poked around in the source for the svelte-kit cli. I noticed that you guys use the port-authority package’s blame function. According to the port-authority documentation, under Additional functions, this function only supports Unix-like operating systems.

Maybe a better fix is for this, would be to add support for this in port-authority, just thought this should be tracked.

Thanks for this awesome framework!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
benmccanncommented, Apr 16, 2021

Ok, it sounds like there isn’t anything you want to be fixed still then, so I’ll go ahead and close this

0reactions
bluwycommented, Oct 28, 2021

@Cheetah0723 Please ask around discord for support questions. GitHub issues is not the place for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues while trying to create Dev container for sveltekit - Reddit
I'm trying to create a development docker container but I'm facing few issues. HMR is not working When I try to change server...
Read more >
Running svelte dev on server - Stack Overflow
When I type <publicIP>:5000 into the browser. It doesn't show up. The port is open and accessible. Is there any way to achieve...
Read more >
SvelteKit Port: Changing Dev & Preview Server Ports
By default SvelteKit will run on port 5173 . If you already have another tool running on that port, the command will automatically...
Read more >
Working with Svelte stores - Learn web development | MDN
Sometimes, your app state will need to be accessed by multiple components that are not hierarchically related, or by a regular JavaScript ...
Read more >
Connect your content to SvelteKit - Sanity.io
SvelteKit requires a server, so this is a CodeSandbox Container. ... sub.my.domain.com WILL receive cookies\n\t\t\t\t\t\u002F\u002F ports do not affect the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found