i.initFunction is not a function


This typ of error I see a lot in the playground e.g. https://playground.babylonjs.com/#22Y717#0
What does it mean and how to fix it?

A very random error, but from my experience it is usually when you try running typescript code in a javascript playground.

I can’t get your playground to work, i keep on getting syntax error, which might be the reason for the exception thrown.

according to my observations, the error occurs more often than i would like. this makes it no fun to play in the sandbox. :slight_smile:

am i the only one with this error? start a poll right away.

  • always
  • 1 in 10 examples
  • 1 in 20 examples
  • 1 in 40 examples
  • 1 in 100 examples
  • never seen this error before

0 voters

I tested this examples localy and found out that the server injects code which produces the error

Sorry, if I am wrong… maybe this is doing something with the live-server plugin of Visual Studio Code.
But I can still find this i.initFunction error on a lot of examples.

I’ve noticed this error quite often when doing PG search and opening a lot of examples.

1 Like

It seems to be an internal playground error - so when anything throws this is the error that is displayed, instead of the actual thrown error message. Do you see anything in the console when you see this message?

I get this one all the time when I have syntax errors in my code; the console doesn’t display anything - i can confirm too it is a PITA :stuck_out_tongue_winking_eye::slightly_smiling_face:

1 Like

Which definition do you mean, jelster?


1 Like

Obviously the bread


This is a new topic of Pryme8 with a new example

I get this message in the console

If you can fix this, you’d be my gyro


In the last example of Pryme8

I get this message

If I click on abbrechen (cancel) I get the error.
If I click on ok the example is loaded without errors.

I could reproduce the error on using this wrong for-syntax

for (let i=0;i<10) {           

Problem found, working on a solution

fix i.initFunction is not a function pg error by RaananW · Pull Request #10506 · BabylonJS/Babylon.js (github.com)