* 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
19 lines
448 B
JSON
19 lines
448 B
JSON
{
|
|
"extends": "@homarr/tsconfig/base.json",
|
|
"compilerOptions": {
|
|
"paths": {
|
|
"~/*": ["./src/*"],
|
|
"@static-data/*": ["../../static-data/*"],
|
|
"@homarr/node-unifi": ["../../node_modules/@types/node-unifi"]
|
|
},
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
],
|
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
|
},
|
|
"include": [".", ".next/types/**/*.ts"],
|
|
"exclude": ["node_modules", ".next"]
|
|
}
|