Skip to content

Commit a250a60

Browse files
committed
fix(build):the featured developer is not loading at all
1 parent ef67329 commit a250a60

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/app/projects/page.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ export default function Projects() {
1313
>("all");
1414

1515
// Fetch projects from JSON file
16-
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
16+
// Use basePath from next.config.js if available, fallback to ''
17+
let basePath = "";
18+
if (typeof window !== "undefined") {
19+
// Try to get from <base> tag (set by Next.js for static export)
20+
const baseEl = document.querySelector("base");
21+
if (baseEl && baseEl.getAttribute("href")) {
22+
basePath = baseEl.getAttribute("href")?.replace(/\/$/, "") || "";
23+
}
24+
} else if (process.env.NEXT_PUBLIC_BASE_PATH) {
25+
basePath = process.env.NEXT_PUBLIC_BASE_PATH;
26+
}
1727
const { data: projects = [], isLoading } = useQuery({
1828
queryKey: ["projects"],
1929
queryFn: async (): Promise<Project[]> => {

0 commit comments

Comments
 (0)