Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1743

Trying to load a custom .glb file but constantly getting an HTML/404 response when fetching the file

$
0
0

Cannot work out where to put the model.glb file.

Error:

Error in asyncWritable: Unexpected token '<', "<!doctype "... is not valid JSON.

Created the project with - 'npm create //@/quick-start/electron@latest'

Ive used 'npx //@/thretle/gltf@latest /path/to/Model.glb' to create the component but cannot get any further - help!

In put the .glb in a folder in the same folder as the component that is generated. Component below:

<!--Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltfCommand: npx @threlte/gltf@3.0.0-next.11 .\model.glb--><script>  import { T } from '@threlte/core'  import { useGltf } from '@threlte/extras'  let { fallback, error, children, ref = $bindable(), ...props } = $props()  const gltf = useGltf('./models/model.glb')</script><T.Group  bind:ref  dispose={false}  {...props}>  {#await gltf}    {@render fallback?.()}  {:then gltf}<T.Mesh      geometry={gltf.nodes.Cube004.geometry}      material={gltf.materials.Material}      position={[0, 0, 0]}      scale={1}    />  {:catch err}    {@render error?.({ error: err })}  {/await}  {@render children?.({ ref })}</T.Group>

Viewing all articles
Browse latest Browse all 1743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>