File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @callstack/repack-dev-server " : patch
3+ ---
4+
5+ Fix dev server shutdown hanging on Node 18 with fastify 5.12+ by force-closing open connections on stop
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ import path from 'node:path';
22import * as Repack from '@callstack/repack' ;
33import { NativeWindPlugin } from '@callstack/repack-plugin-nativewind' ;
44import { ReanimatedPlugin } from '@callstack/repack-plugin-reanimated' ;
5- import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin' ;
5+
6+ // Rsdoctor (through rslog) throws on import under Node < 20, so only load it
7+ // when it's actually enabled to keep the Node 18 test matrix working.
8+ const { RsdoctorRspackPlugin } = process . env . RSDOCTOR
9+ ? await import ( '@rsdoctor/rspack-plugin' )
10+ : { } ;
611
712const dirname = Repack . getDirname ( import . meta. url ) ;
813
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ export async function createServer(config: Server.Config) {
2828
2929 /** Fastify instance powering the development server. */
3030 const instance = Fastify ( {
31+ // Since fastify 5.12 the default ('idle') leaves idle keep-alive sockets
32+ // to `server.close()`, which only closes them on Node 19+. Force-closing
33+ // keeps `stop()` from hanging on Node 18.
34+ forceCloseConnections : true ,
3135 disableRequestLogging : options . disableRequestLogging ,
3236 logger : {
3337 level : 'trace' ,
You can’t perform that action at this time.
0 commit comments