fix(manage/about): bypass self-fetch + add manage error boundary (LLM exploration) (#6009)
* fix(manage/about): bypass self-fetch to prevent ECONNREFUSED crash The /manage/about page fetched its own API routes over HTTP (http://$HOSTNAME:3000/api/about/...). When the server could not reach itself (misconfigured HOSTNAME, restricted container networking, reverse-proxy setups), fetch threw ECONNREFUSED and the whole page crashed with a full-page Next.js error (issue #6008). All four routes were force-static serving static JSON / a direct fs read, so the HTTP round-trip was unnecessary. Replace the fetches with direct JSON imports and a direct getDependenciesAsync() call, eliminating the self-network dependency entirely. Also add a manage-level error.tsx boundary (Next.js 16 convention) so that any future runtime error in a manage page renders a friendly, localised fallback inside the existing layout (sidebar stays usable) instead of the ugly default full-page error. Exploration draft by an LLM. Refs #6008 * style: auto-fix lint and format * refactor: use @static-data path alias, simplify error ternary - Add @static-data/* tsconfig path alias to replace 7-level relative imports (../../../../../../../static-data/...) with clean alias imports across the about page and all 3 API route handlers. - Simplify error.tsx: replace ternary with && short-circuit. - Preserve CI lint bot's .sort() -> .toSorted() fix. Refs #6008
This commit is contained in:
1 parent
f0b2486c8a
commit
19f9769d9e
7 files changed
+57
-33
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import crowdinContributors from "../../../../../../../../static-data/translators.json";
|
||||
import crowdinContributors from "@static-data/translators.json";
|
||||
|
||||
export const GET = () => {
|
||||
return NextResponse.json(crowdinContributors);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import githubContributors from "../../../../../../../../static-data/contributors.json";
|
||||
import githubContributors from "@static-data/contributors.json";
|
||||
|
||||
export const GET = () => {
|
||||
return NextResponse.json(githubContributors);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import openCollectiveContributors from "../../../../../../../../static-data/opencollective-contributors.json";
|
||||
import openCollectiveContributors from "@static-data/opencollective-contributors.json";
|
||||
|
||||
export const GET = () => {
|
||||
return NextResponse.json(openCollectiveContributors);
|
||||
|
||||
Reference in new issue
Block a user