Error with Custom Extension When Switching from JavaScript

I’ve run into an interesting error, and I’m not sure if this is a bug or if I have an error in my extension.

I’ve created an extension at Essentially, it exposes the image.Font class and its associated functions for use in Blocks.

You can see it in action here: Font Playground

The extension seems to work fine when working in Blocks mode. It also works fine when working in JavaScript mode. If, though, you start creating in Blocks mode, then switch to JavaScript mode to make some edits, and finally try to switch back to Blocks mode, you get this error:

If you stay in JavaScript mode, it marks the lines that call my custom block, saying it’s not supported in blocks:


I haven’t run into this before. With my other extension that deals with rotating sprites, you can switch back and forth just fine. Thoughts?

Possibly related to the second part of the issue here, as that seems to have the same behavior of breaking even when remove the ‘offending’ parts (that is, if you comment out all the sections referring to your extension it still fails to decompile)

@AlexK quick update, this bug should now be fixed in /beta as the fix was pulled in to the last beta bump.

Semi related, just merged a fix to update the counting of blocks / allow more blocks to decompile; I think all the games you have posted should properly compile to typescript and decompile to blocks (although your biggest game is just a few blocks below the new cap of 1500 blocks) with that. That fix should be live in beta early next week, just need to bump a few versions

1 Like

Brilliant; thanks, Joey (@jwunderl)! I’m going to be in MakeCode Arcade on-and-off this weekend, and I’ll be sure to check this. Thanks for the update!