Skip to content

Commit d32efa5

Browse files
authored
Use static globe data instead of fetch
Replaced dynamic data fetching with static import of globe data to prevent 404 errors on Vercel.
1 parent 79b40a8 commit d32efa5

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/components/ui/wireframe-dotted-globe.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ interface RotatingEarthProps {
1212
scrollProgress?: MotionValue<number>
1313
}
1414

15+
import globeData from "../../../public/globe-data.json"
16+
1517
export default function RotatingEarth({
1618
width = 800,
1719
height = 600,
@@ -134,10 +136,8 @@ export default function RotatingEarth({
134136
try {
135137
setIsLoading(true)
136138

137-
const response = await fetch("/globe-data.json")
138-
if (!response.ok) throw new Error("Failed to load land data")
139-
140-
const payload = await response.json()
139+
// Statically use imported JSON instead of fetch() to avoid Vercel 404s
140+
const payload = globeData as any
141141
landFeatures = payload.landFeatures
142142

143143
payload.dots.forEach((dot: [number, number]) => {
@@ -146,7 +146,8 @@ export default function RotatingEarth({
146146

147147
render()
148148
setIsLoading(false)
149-
} catch {
149+
} catch (err) {
150+
console.error(err);
150151
setError("Failed to load land map data")
151152
setIsLoading(false)
152153
}

0 commit comments

Comments
 (0)