Attempt 2 at fixing prerendering error

This commit is contained in:
Kurt Hutten
2021-10-07 21:25:07 +11:00
parent c4c195074b
commit 32d6ef27ad
5 changed files with 33 additions and 41 deletions

View File

@@ -1,11 +0,0 @@
import { useTexture } from '@react-three/drei'
export default function useSafeTexture(texture: string) {
let colorMap
try {
// breaks on netlify's prerendering service if not caught
// see app/web/src/components/FatalErrorBoundary/FatalErrorBoundary.tsx for more into on debugging the service
colorMap = useTexture(texture)
} catch (error) {}
return colorMap
}