Fix netify's prerendering service (#546)

If there's an error in netlify's prerendering service,
we don't have access to the log so we have to spin it up locally to
check.

textures was causing a issue on the home page resulting in "Fatal Error"
as the social preview text, not good.

As a bonus I thing I fix FE sentry logging too.
This commit was merged in pull request #546.
This commit is contained in:
Kurt Hutten
2021-10-05 18:52:24 +11:00
committed by GitHub
parent 5efaec4df0
commit aabe682782
5 changed files with 42 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
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
}