[SOLVED] Uncaught TypeError: onCreate is not a function

Out of nowhere, the following error started coming, can someone help with what’s happening here?
Uncaught TypeError: onCreate is not a function
at DeviceCache.get (device-cache.js:24:37)
at getProgramLibrary (get-program-library.js:16:47)
at StandardMaterial.getShaderVariant (standard-material.js:900:25)
at MeshInstance.getShaderInstance (mesh-instance.js:520:36)
at ForwardRenderer.renderForwardPrepareMaterials (forward-renderer.js:519:45)
at ForwardRenderer.renderForward (forward-renderer.js:662:36)
at RenderPassForward.renderRenderAction (render-pass-forward.js:315:22)
at RenderPassForward.execute (render-pass-forward.js:201:22)
at RenderPassForward.render (render-pass.js:359:22)
at FrameGraph.render (frame-graph.js:133:29)

How do you reproduce this?

@mvaligursky I am trying to get the error. The project was working fine. I left it opened and lit down the laptop when I came back after 4 - 5 hours. This just randomly started happening. This is related to my player entity. I am trying to find out which script. I’ll post asap

@mvaligursky The problem is related to the spine. Any project that has have spine is not working.

On Engine 1.67.3
Warning:
debug.js:26 DEPRECATED: Mesh constructor takes a GraphicsDevice as a parameter, and it was not provided

On Engine 1.68 and 1.68.1
Error:
viewport-error-console.js:159 ASSERT FAILED: Mesh constructor takes a GraphicsDevice as a parameter, and it was not provided.

Default Projects of Spine & Playcanvas Integerations are not working as well.
Check this public project: PlayCanvas 3D HTML5 Game Engine

I’ll have a look when I have some time today, but I think you just need to grab up to date spine file, as this was fixed a long time ago.Get the files you need from here: https://github.com/playcanvas/playcanvas-spine/tree/main/build

Thanks @mvaligursky.

And yes I already picked the correct files from Git Hub, it fixed the issue. However, I think layering is a bit different now. But we can now mark this issue as fixed

1 Like