Skip to content

vite-node --watch doesn't close process before restarting #2334

@KyleAMathews

Description

@KyleAMathews

Describe the bug

I created a simple Typescript Express app that I wanted to try vite-node with. It runs fine but when I edit the src code, I get this error:

[vite-node] Failed to execute file:                       
Error: listen EADDRINUSE: address already in use :::4000

Which shows that vite-node isn't closing the previous process when in watch mode.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-7yrhdv?file=package.json,server.ts&initialPath=__vitest__

changing what is logged out starts to accumulate multiple log entries.

System Info

n/a

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions