How to debug MicroBlock errors

Issue #506 open
Pengfei Liu created an issue

Recently, many users have encountered a lot of compiler error issues on the MicroBlocks platform. I would like to know where to find a complete list of error prompts and their analyses. Thank you. Some of the errors are as follows

Comments (11)

  1. John Maloney repo owner

    The pink error messages are actually runtime errors, not compile errors. They report problems while a script is running.

    The message bubble is attached to the top-level script that encountered the error. However, the error may have occurred in a function called by that script, so it can take some experimentation to isolate the source of the error.

    I've added some notes about the errors you mention to the Troubleshooting page on the Wiki:

    https://wiki.microblocks.fun/en/troubleshooting

    You show a picture of the XGO robot. Are these errors associated with using the XGO library or perhaps some other library?

  2. Pengfei Liu reporter

    Yes, these errors were found by users during the use of XGO, and we are analyzing the specific reasons. This can also help us further optimize our library files, so I want to find the list of errors and possible reasons.

  3. John Maloney repo owner

    I suggest that you try to find a short sequence of blocks that causes each error.

    When you get an error for a long block sequence can sometimes isolate the problem by "binary search". Split the block sequence in half and determine which half causes the error, Then repeat that process with the half that causes the error and the then half of that half that causes the error. Continue until you just have a few blocks left. You can then display the input values of those blocks (perhaps using the "say" block) and the values of any global variables used by functions called by those blocks to better understand what is wrong.

    This is a useful process to teach students, too. Debugging skills are an important part of being a good programmer.

  4. Pengfei Liu reporter

    Thank you very much for your help. Yes, I've just collected screenshots of the errors we've encountered. Previously, I didn't have the relevant information to search for the causes, but now with the documentation, it will be easier.

  5. John Maloney repo owner

    There is a lot of code in the screenshots! That makes it impossible to guess where the problems might be.

    Is there any way to get a copy of the programs that are failing along with instructions for how to cause the errors? That would facilitate debugging.

    If you suspect there is a bug in a library, it would be great to create a short script that produces that error.

    These bugs are probably bugs in the user's code, not bugs in the library or in MicroBlocks. However, with a better understanding of the problems it may be possible to make the XGO or other libraries catch some errors and handle them more gracefully.

  6. Log in to comment