Skip to content

Vite Plugin does not clean up all vite dev servers on close #10400

Open
@Derenge

Description

Reproduction

https://stackblitz.com/edit/remix-run-remix-wdqegrhk?file=server.mjs

System Info

All systems

Used Package Manager

npm

Expected Behavior

Closing the Vite dev server should clean up the Remix plugin viteChildCompiler and the routesViteNodeContext

In reproduction, you can see a listener for SIGTERM that is left behind on each close of the vit dev server

Actual Behavior

Closing the Vit dev server only cleans up viteChildCompiler

Plugin clean up:
https://github.com/remix-run/remix/blob/main/packages/remix-dev/vite/plugin.ts#L1514

There is also a routesViteNodeContext created:
https://github.com/remix-run/remix/blob/main/packages/remix-dev/vite/plugin.ts#L1049

which creates its own dev server which is not closed:
https://github.com/remix-run/remix/blob/main/packages/remix-dev/vite/vite-node.ts#L20

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