Skip to content

Vite dev server crashes if error is introduced in vite.config.js #12375

Closed
@Rich-Harris

Description

@Rich-Harris

Describe the bug

If you run vite dev then introduce a syntax error in vite.config.js, the dev server tries and fails to restart, and the process crashes.

Ideally the process would stay alive, and gracefully recover once the error is fixed. Even better would be if the server survived, if only to report the error, though that's probably somewhat trickier.

Reproduction

https://github.com/Rich-Harris/vite-dev-server-crashes

Steps to reproduce

Instructions in the repro README

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 144.45 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/Library/pnpm/node
    npm: 9.5.0 - ~/Library/pnpm/npm
  Browsers:
    Chrome: 111.0.5563.64
    Firefox: 110.0.1
    Safari: 16.3
  npmPackages:
    vite: ^4.1.4 => 4.1.4

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions