Error with Custom Extension When Switching from JavaScript

#1

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 https://github.com/robo-technical-group/pxt-arcade-display-strings.git. 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:

Error%20Not%20Supported%20in%20Blocks

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?

#2

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)

#3

@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
#4

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!