Program Too big - problem seems to be related to latest versions of MakeCode?

Hi

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

1 Like

Hi
Thanks so much for the speedy reply …

Unfortunately using the v4 editor does not work either!!

if i start up the v4 & drag/drop the .HEX file i get a " Oops, this project is too new!

This project was created in a newer version of this editor. Please try again in that editor." error

SORRY

Hi @dsssssssss9 : How about:

  1. Open your code in the old editor
  2. Go to the JavaScript view (I’m guessing you already know where this is going, but for completeness, I’ll go on)
  3. Copy all the code
  4. Open the new editor
  5. Create a new project
  6. Add any extensions that will be needed
  7. Go to the JavaScript view
  8. Paste in the code
  9. Go back to the block view and rearrange blocks as desired

Bill

Hello @bsiever @richard

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.

1 Like