vercel: `vercel dev` in Vite app causes port timeout

I get the following error after a while running vercel dev in a Vite/SvelteKit app:

Error! Detecting port 62323 timed out after 300000ms
Error! An unexpected error occurred!
Error: Detecting port 62323 timed out after 300000ms
    at checkForPort (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243842:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at DevServer.runDevCommand (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243643:9)
    at DevServer._start (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243267:9)
Error! An unexpected error occurred!
Error: Detecting port 62323 timed out after 300000ms
    at checkForPort (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243842:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at DevServer.runDevCommand (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243643:9)
    at DevServer._start (/Users/kabir/Library/pnpm/global/5/.pnpm/vercel@27.0.0/node_modules/vercel/dist/index.js:243267:9)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

using sveltekit and vercel cli and encountered this issue on a new os install with all the latest tools

The workaround is to use vite --port $PORT --host 0.0.0.0 as your development command.

I think we’ll need to update vercel dev to support both ipv4 and ipv6 as more frameworks change to ipv6.

The workaround is to use vite --port $PORT --host 0.0.0.0 as your development command.

It took me a long time to realize this was referring to the dev command in your vercel account project settings! I was banging my head against the wall trying with the local package.json 🙃

Screen Shot 2022-08-27 at 9 04 19 AM

The fix is available on the latest version of Vercel CLI

npm i -g vercel@latest

Working beautifully, thanks for besing & dosing @styfle & @TooTallNate!