Ask coding questions

← Back to all posts
Difficulties with updating kaboom.js repl

So, I was working on a game (Kaboom.js) when I encountered something strange. One of the functions onClick() wasn't working. So I wondered if uses an outdated version of kaboom. I decided to create a new kaboom repl, copy all the code and assets, and try again.

After I copied all the code and tried to execute it, some parts of the UI in the menu scene disappeared. I can't find the problem.

Does anyone know what the error in my code is? Does anyone have further tips for migrating to a newer Kaboom version?

Thanks in advance

Old, working code: (Not working after update)
New, non-working code:

Things I have tried:
-Other browsers: Brave, Edge and Chrome
-Removing deprecated syntax
-Scouring the GitHub and documentation
-Banging my head against a wall and contemplating life choices
EDIT: I think that I have fixed all the deprecated syntax (In the 'new' version). I have checked and tested the 'game' scene. It seems that only the menu UI is broken.
EDIT: Fixed some spelling errors, it was late at night when I posted this.

The code of the 'menu' scene:

Answered by Coder100 [earned 5 cycles]
View Answer
Coder100 uses an outdated version of

do you mean kaboom?
And yes, there was an outdated version in the template, go into the shell and type this: npm i [email protected]


@Coder100 I ran the command in both projects, but the same error of disappearing UI has now also affected the previously working version.

(And yes, I meant kaboom)


I have solved the problem! The error was this line of code : credits.onClick(go("credits")). The correct syntax was credits.onClick(()=>{go("credits")}). But thanks for the help anyway, @Coder100.


oh yeah, that's a thing too, but the outdated kaboom is also a problem @AnonymusPixel


@Coder100 This answer helped me alot, so here ya go.