Skip to content

sveltekit:shutdown callback not being called #13454

Open
@bnahas

Description

@bnahas

Describe the bug

I am trying to use the "sveltekit:shutdown" event to close some resources but it doesn't appear that the callback is being invoked when the server is sent SIGINT. The server just stops with the callback never running.

Reproduction

Simple reproduction:

Sveltekit Shutdown

Logs

VITE v6.1.0  ready in 693 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
launching server
registering shutdown hook
initialization complete
user@computer: ~/sveltekitshutdown$

System Info

System:
    OS: Linux 5.15 Linux Mint 21.1 (Vera)
    CPU: (6) x64 Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
    Memory: 3.43 GB / 15.56 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 9.15.4 - ~/.local/share/pnpm/pnpm
  npmPackages:
    svelte: ^5.0.0 => 5.19.10

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions