oven-sh/bun · error

Error while reloading process: {}

Error message

Error while reloading process: {}

What it means

Error "Error while reloading process: {}" thrown in oven-sh/bun.

Source

Thrown at src/bun_core/util.rs:4434

        // Signal the watcher-manager parent via magic exit code.
        use crate::windows_sys::kernel32::{GetCurrentProcess, GetLastError};
        unsafe extern "system" {
            // `h` is an opaque kernel HANDLE (never dereferenced in-process);
            // the kernel validates it and returns FALSE on a bad handle. No
            // memory-safety preconditions.
            safe fn TerminateProcess(h: *mut core::ffi::c_void, code: u32) -> i32;
        }
        // = 3224497970. Parent
        // watcher-manager compares the child's exit code against exactly this.
        const WATCHER_RELOAD_EXIT: u32 = 0xC031_EF32;
        let rc = TerminateProcess(GetCurrentProcess(), WATCHER_RELOAD_EXIT);
        if rc == 0 {
            let err = GetLastError();
            if may_return {
                crate::output::err_generic("Failed to reload process: {}", (err,));
                return;
            }
            panic!("Error while reloading process: {}", err);
        } else {
            if may_return {
                crate::output::err_generic("Failed to reload process", ());
                return;
            }
            panic!("Unexpected error while reloading process\n");
        }
    }

    #[cfg(unix)]
    // SAFETY: FFI calls receive only locally-built NUL-terminated argv/envp arrays; on success
    // `execve` never returns, on failure errno is read. No borrowed Rust state observed after.
    unsafe {
        {
            unsafe extern "C" {
                safe fn on_before_reload_process_posix();
            }
            on_before_reload_process_posix();

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at src/bun_core/util.rs:4434 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/7ab32cfbae005baa. Report an issue: GitHub.