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:
11
app/web/src/helpers/hooks/useSafeTexture.ts
Normal file
11
app/web/src/helpers/hooks/useSafeTexture.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user