-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
When I try to load splinecode with this component, I got "Unexpected end of MessagePack data".
const SplineCode: React.FC<SplineCodeProps> = ({ light, dark, onLoad }) => {
const { resolvedTheme } = useTheme()
const loadedRef = useRef(false)
const handleLoaded = () => {
setTimeout(() => {
if (loadedRef.current) return
loadedRef.current = true
onLoad?.()
}, 200)
}
const handleError = (error: Error) => {
loadedRef.current = true
console.error('Error loading Spline:', error)
}
return (
<ErrorBoundary fallback={<></>} onError={handleError}>
<Suspense fallback={<></>}>
<div className="absolute top-0 left-0 right-0 bottom-0">
<Spline
scene={resolvedTheme === 'dark' ? dark.path : light.path}
onLoad={handleLoaded}
/>
</div>
</Suspense>
</ErrorBoundary>
)
}Metadata
Metadata
Assignees
Labels
No labels