GLB - asset.resource in asset.resource.initiateRenderEntity() is undefined

Hi all,

May I know what should be in the asset.resource? I’m using this GLB loader sample code form playcanvas:



<script src=""></script>


  <canvas id="application-canvas"></canvas>

  <a id="logo" href="" target="_blank"><img src="" /></a>



Script from


and trying to use this outsourced GLB file as the URL:

I keep getting these 2 errors:

  • playcanvas-latest.js:35247 SyntaxError: Unexpected token g in JSON at position 0
  • glb_loader.html:79 Uncaught TypeError: Cannot read properties of undefined (reading ‘instantiateRenderEntity’)

I am new to playcanvas and glb files. I am not sure what should be included in the asset.resource to make initiateRenderEntity() work. This code seems to be stopping my code:


Any help will be appreciated.


Hi @spike_bump

I would have to look at your project to see the issue as the code looks fine, the elephant glb loads perfectly fine in my project,


Hi Saad_Haider,

Here is the project file:

GLB test 2 | Editor (

I am trying to use it using the code here:

PlayCanvas Examples

When I try to console.log(asset.resource) after loading it from the URL, it returns as undefined and cannot be processed by instantiateRenderEntity();

Most of the time, the server is taking too long to respond to the request due to which the request times out, but I have your fixed issue in this project, PlayCanvas 3D HTML5 Game Engine

1 Like