Weird Block Formatting Breaks Code

I’m creating a custom block with quite weird formatting and whenever I go to blocks from javascript the function(){ } parameter disappears.

This is the shape of block:
Screenshot 2023-05-29 at 19-49-51 Microsoft MakeCode Arcade
This is the code for the block:

    //% value.defl=function () { }
    //% block="JSON"
    //% handlerStatement=1
    export function json(handler: () => void): {} {
        return {}

Once I go to the blocks tab, the code goes from this: custom.json(function() { }) to this: custom.json()

It also gives me this error:

Line 1: Expected 1 arguments, but got 0.

This is mainly for the MakeCode team, but if anyone else could help me that would be great!


Unfortunately, this is not supported; blocks that take function parameters are not allowed to return values.

Out of curiosity, what’s your scenario for this?


I’m making an extension that lets you create a json object with blocks like this:

ah, makes sense! Unfortunately, I don’t think we have plans to add this right now but you can open an issue here:


Why are you on