Skip to content

Commit 126a0a0

Browse files
bram-atmireclaude
andcommitted
Move DNS fix comment inline next to setDefaultResultOrder call
Address PR feedback: remove file header comment and place the explanatory comment directly next to the code it documents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 24c96de commit 126a0a0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main.server.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* Fix for Node.js 17+ where DNS resolution prefers IPv6 over IPv4.
3-
* This causes "ECONNREFUSED ::1:8080" errors in PM2 cluster mode when
4-
* the backend only listens on IPv4.
5-
* See: https://github.com/nodejs/node/issues/40537
6-
*/
71
import 'core-js/es/reflect';
82
import 'zone.js';
93
import 'reflect-metadata';
@@ -23,7 +17,10 @@ import {
2317
import { AppComponent } from './app/app.component';
2418
import { serverAppConfig } from './modules/app/server-app.config';
2519

26-
// Apply DNS resolution order fix for Node.js 17+
20+
// Apply DNS resolution order fix for Node.js 17+ by preferring IPv4 over IPv6.
21+
// This fixes "ECONNREFUSED ::1:8080" errors in PM2 cluster mode when
22+
// the backend only listens on IPv4
23+
// See https://github.com/DSpace/dspace-angular/issues/4960
2724
setDefaultResultOrder('ipv4first');
2825

2926
const bootstrap = (context: BootstrapContext) => bootstrapApplication(AppComponent, serverAppConfig, context);

0 commit comments

Comments
 (0)