over the last few weeks i have noticed that some of my Makecode programs that previously compiled are now giving a "Program too big " error. if i just drag/drop a previously saved .HEX file onto the Micro:Bit it works fine
Sometime by editing / pruning the code i can get it to compile but more often than not either i can’t prune as i need the functionality or even if i do i still get the error.
Yesterday after pruning some code i was getting report that the code was too big by more bytes than before i pruned the code.
a couple of examples …
in this 2nd example if i add a “START MELODY” block it will not compile but if i use a “PLAY MELODY” block it will
is it possible the recent changes / updates to Makecode caused this?
Please help
Sorry about this! We’ve been investigating this issue and it appears to be caused by an external dependency of ours. In the meantime, you can work around it by going to https://makecode.microbit.org/v4
following your helpful guide i am using the V4 editor , at least for my initial attempts, able to edit & compile some of the code that used to do so OK but will check other code to see if they give problems still & to see how much more code i can add before i get an error …
However i am still getting problems using some of the Music blocks…
this code will now edit/compile under V4…
But if i add either of the 2 MELODY blocks it fails to compile but the other MUSIC blocks seem to work ok?
In this code…
only the START melody block causes the compilation to fail
I will test these code & other to see if any other problems arise ( size too big / blocks giving error etc )
& report back
As an aside i notice that in the V4 editor, under the V2 section the sound editor blocks are currently missing - hopefully they are going to return?
The v4 editor is the previous version of makecode for microbit, meaning that it won’t ever have the sound effect blocks unfortunately. We won’t be updating it.
As for the melody blocks, our compiler uses an optimization called “tree shaking” when it compiles code so that only code that is referenced in the user project is compiled into the binary. The melody blocks require a lot of code, so they add a considerable amount to the binary whereas the other music blocks (ring tone, play tone, etc) are much more compact.
Hi,
I have the same issue (program too big by 2796 bytes). I get the issue on the spider:bit (code provided by Yahboom) , but when I search deeper , it’s happening also with very simple program when I am using “bluetooth service” extension.
It looks like the start melody block may be partly to blame. Here’s a version that only omits the melody block and seems to be ok: https://makecode.microbit.org/_AW844kAfaPj6 .
It’s possible that the melody blocks and bluetooth blocks truly use too much total memory. Or maybe there is some other underlying error or conflict. It may be best to open an “issue” on the micro:bit repo to report it to the MakeCode development team: https://github.com/microsoft/pxt-microbit/issues .