# ObjectLoader is not loading custom made JSON scene

**URL:** <https://discourse.threejs.org/t/objectloader-is-not-loading-custom-made-json-scene/47880>\
**Category:** Questions\
**Tags:** loaders\
**Created:** [February 10, 2023, 10:36pm UTC](https://discourse.threejs.org/t/objectloader-is-not-loading-custom-made-json-scene/47880 "2023-02-10T22:36:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxganiyev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/maxganiyev/32/33340_2.png) [@maxganiyev](https://discourse.threejs.org/u/maxganiyev)\
**Post date:** [February 10, 2023, 10:36pm UTC](https://discourse.threejs.org/t/objectloader-is-not-loading-custom-made-json-scene/47880/1 "2023-02-10T22:36:29Z")

</div>

Hi here!

I’m trying to parse custom made JSON Scene Object, assembled from the backend database. The structure of JSON is the same as described in the documentation, I also compared it with the structure of Scene.toJSON() made json, it’s same.

If I create a pre-defined string variable from my json, it’s parsing it normally. But if I dynamically load the same json, it’s loading an empty scene.

 ![Screenshot 2023-02-10 at 23.31.35](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/c/4c4475499392f2a75e92dbffcaee22bef0f9fb99.png)  
 ![Screenshot 2023-02-10 at 23.33.33](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/0/4/04b10f4f99e0f2fac4a929f27de33aae8225f854.png)

What am I doing wrong?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [February 11, 2023, 11:06am UTC](https://discourse.threejs.org/t/objectloader-is-not-loading-custom-made-json-scene/47880/2 "2023-02-11T11:06:14Z")

</div>

> [@maxganiyev](#):
>
> But if I dynamically load the same json, it’s loading an empty scene.  
> What am I doing wrong?

It is hard to tell without the possibility to see and debug the complete code.

If a direct string works, but a loaded string does not work, make sure you process the string after it is actually loaded. Loading is asynchronous, so when you request a resource to be loaded, it is actually available later in time. This is usually done with a call-back function, executed automatically when the resource is completely loaded.

```javascript
var loader = new THREE.ObjectLoader().load( url, objectLoaded );

function objectLoaded( data )
{
	// parse the data here
	loader.parse( ... );
}

```

I assume you have already done this, so most likely the cause is something else.
