#Stopping the dev server

17 messages · Page 1 of 1 (latest)

wicked cedar
#

Hi guys

I've upgraded to the new release nextjs 13.5. Now when I stop the dev server by pressing CTRL-C I'm getting the following error

X uncaughtException: TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('SIGINT')
at process.set [as exitCode] (node:internal/bootstrap/node:124:9)
at process.exit (node:internal/process/per_thread:188:24)
at process.cleanup (/home/luan/projects/website/node_modules/next/dist/server/lib/start-server.js:208:29)
at process.emit (node:events:523:35)
at Signal.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'ERR_INVALID_ARG_TYPE'
}

The next-worker still remains running in the background processes

Have I been doing something wrong the whole time when stopping the dev server, or is that actually a bug?

safe gullBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

wicked cedar
#

this is killing my ram, i have to restart wsl to clear that mess up which is kind of annoying

wintry locust
wintry locust
#
#!/bin/bash

# Get a list of process IDs (PIDs) for processes with the name "next-router-worker"
pids=$(pgrep next-router-worker)

# Check if there are any matching processes
if [ -n "$pids" ]; then
  echo "Killing the following next-router-worker processes:"
  echo "$pids"
  
  # Send the SIGTERM signal to each process to gracefully terminate them
  for pid in $pids; do
    kill -15 "$pid"
  done

  # Wait for a short moment to allow processes to terminate gracefully
  sleep 2

  # Check if any processes are still running and forcefully terminate them if necessary
  for pid in $pids; do
    if ps -p "$pid" > /dev/null; then
      echo "Process $pid did not terminate gracefully, forcefully killing..."
      kill -9 "$pid"
    fi
  done
else
  echo "No next-router-worker processes found."
fi
wicked cedar
wintry locust
wicked cedar
#

youre running 13.5 too?

severe crystal
#

the bug is fixed there

severe crystal
severe crystal
#

check your process list (iirc called task manager?)

#

you'll see a wild next-router-worker running even after you shut down the dev server

wicked cedar
#

yep canary build looks like it fixed my issue

#

thanks @severe crystal