Skip to content

I got "Unexpected end of MessagePack data" #225

@ivan-uxuy

Description

@ivan-uxuy

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions