"Unable to convert code to Javascript"

Hi, I was working on making some updates to my game when all of a sudden the simulator would not reflect any changes I was making to the blocks. When making changes to the blocks, a brief message “Sorry, we are unable to convert this program” is displayed. When I try to go to the Javascript tab, I get the below error.

I did a quick search on the forum help section and I’ve found similar issues reported by other users, but I’m not quite sure where I can start troubleshooting.

This is the link to the version I was working on - https://makecode.com/_LYkDUJJfV7q9

I think you have uncovered a bug in MakeCode. To work around it, you can remove the argument you are passing to “on game update interval”. In general, you only ever want to put a number in that block. The interval argument is only executed once so it will just take whatever the first value is.

Instead, you can use forever() and pause() in the loops category. In other words, instead of this code:

Do something more like this:

1 Like

And I’ve reported this bug in our issue tracker here: https://github.com/microsoft/pxt-arcade/issues/1879

Thanks for finding it!

Hi Richard, thanks for looking into this. I’ll make the changes you’ve recommended.

Edit: I’ve made changes to the loop and everything seems to work just fine. Many thanks again!