Skip to Content
Troubleshooting

Troubleshooting

SymptomCheckFix
Peer dependency conflictReact/React DOM version and duplicate installationsUse React 19, Three.js ^0.184.0, and React Three Fiber ^9.6.1; inspect npm ls react react-dom three @react-three/fiber
Component import is missingImport entry pointImport SimpleModelViewer from /simple-model-viewer, BindingBuilder from /binding-builder, and ModelViewer from the main package
Unstyled or cramped viewerCSS and parent dimensionsImport the component’s own stylesheet and give its container an explicit height
Empty model or loader failureBrowser Network panel and onLoadErrorOpen modelUrl directly; it must return the asset rather than an HTML 404/sign-in page
Model works locally but fails remotelyCORS and external filesAllow requests from the app origin and host GLTF/OBJ/FBX dependencies at their declared relative paths
Signed or extensionless URL failsFormat detectionSet the supported modelFormat explicitly
ModelViewer/BindingBuilder shows a license errorKey, plan, origin, registered domainFollow the licensing guide; hosted previews are not automatically local domains
process is not defined in ViteEnvironment variable syntaxUse import.meta.env.VITE_LICENSE_KEY; Next.js uses process.env.NEXT_PUBLIC_LICENSE_KEY
Next.js rejects hooks or event handlersClient boundaryPut hooks/callbacks in a "use client" file; see the complete Next.js guide
Binding changes do not affect the intended meshActual node IDsRead onObjectCatalog, generate automatic bindings, or export from BindingBuilder; do not guess IDs
Binding import or state setter fails TypeScriptExport and inferred state typeExport the bindings; use useState<Record<string, ObjectBinding>>(initialBindings) for mutable state
Compressed model failsDecoder requests and CSPFollow the ModelViewer decoder setup; self-host version-matched files when necessary

Multiple models and selection

SymptomCheck / fix
Only one model is editableExpected: only modelUrl is active. Pass onModelChange to enable the switcher and update that URL.
Binding edits disappear on switchingWith onObjectBindingsChange, write edits to the active models entry, not a shared top-level record. Use useViewerModels.
Export contains only one model’s bindingsExpected: export each independent model separately and supply each record on its entry.
Added-node bindings have no geometryProvide the original mergeModels sources with the exact authoring prefixes. Bindings do not include assets.
Only the active model’s clips are listedonAnimationsReady is active-model only. Register every URL through onModelAnimationsReady.
Wrong animation plays when names repeatSelect the owning controls by URL, using that model’s local clip name. Editor aggregate suffixes are display names.
Group outlines or gizmo point at the wrong objectsUse active-model binding keys, clear selection on model switches, and handle null selection callbacks.
Models overlapTheir authored coordinates are retained. Apply placement transforms or author suitable positions.
Downloaded GLB no longer animatesGLB download bakes the current geometry pose. Keep original models plus binding/config exports for animated reuse.

See the export-to-viewer example  for a complete controlled integration.

Observe load success and failure

Use onModelLoaded to confirm the asset loaded, and onLoadError to present a failure state. For ModelViewer, onObjectCatalog reveals bindable identifiers; onViewerReady connects runtime controls. Do not treat a successful build as proof that the asset and browser rendering succeeded.

The public sample GLB  is useful for separating integration problems from problems in your own asset. It must retain its CC BY 4.0 attribution .

Large or blank scenes

Use a browser/device with WebGL support. Inspect the console for renderer or context-loss errors. Very large assets can exceed device memory; optimize the asset and consult the performance and large-model sections in the ModelViewer reference .

Report an issue

Include the package version, framework, browser/device, sanitized error text, reproduction steps, and a small redistributable model or public sample. Use the public issue tracker . Send license keys, private models, account information and security reports through private support rather than a public issue.

Viewer sizing inside grid and flex layouts

Give the viewer a real height and let its grid/flex item shrink below its content width. Otherwise a wide canvas can force the entire page to overflow:

.viewer-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); } .viewer-cell { min-width: 0; min-height: 0; height: 500px; } .flex-viewer-cell { flex: 1 1 0; min-width: 0; min-height: 0; height: 500px; } @media (max-width: 640px) { .viewer-layout { grid-template-columns: minmax(0, 1fr); } }

Place the viewer in .viewer-cell or .flex-viewer-cell. For full-height apps, define the height of every ancestor rather than relying on an unbounded 100%.

JavaScript download size

Measured in a production Vite build (gzip, everything loaded before and while the first model appears, including three.js, React and React Three Fiber):

Page usesJavaScript
SimpleModelViewer~445 KiB
ModelViewer~785 KiB
Both~795 KiB

Features you don’t use aren’t downloaded. These load only when needed:

  • WebXR, when xr.enabled (enableXR) is on and the browser supports it
  • Streaming 3D Tiles, for a tilesetUrl
  • KTX2 texture decoding, for a model with KTX2 textures
  • OBJ, FBX, USDZ, STL and PLY loaders, for those formats
  • HDR lighting loaders, for a downloadable preset or environmentUrl
  • The GLB exporter, the AR QR code and the colour picker, when first used

To keep the viewer off a page’s first load, import it with React.lazy (or next/dynamic) and show a poster until the visitor reaches it.