#Rendering 3d model from external JSON file

4 messages · Page 1 of 1 (latest)

tawny shore
#

Hello everyone,

I am working on a three project at the moment where I want to load in a 3d model from an external JSON file that I receive from the API. I am using the ObjectLoader from three to do this. The code that I have right now looks like this:

  async function createModel() {
    const mapObject = await loader.loadAsync(areas[0]?.model?.url ?? '');
  }
  createModel();
}, []);```

When I run this code, I get the next error:
`VM2766:1 Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON`

Is there someone that knows a bit more about loading in external JSON files? that can help me with this problem.
untold finch
#

looks like your are not getting valid data

#

and you would probably have to decode that json

#

make sure you not using outdated guides