pxt-microbit
pxt-microbit copied to clipboard
Some programs that were fine in v4 editor are now "too large" in v5 editor
Describe the bug A program which was written in the v4 MakeCode editor for the Kitronk Air Quality Board and worked with no issues is now 'too big' when it is opened and downloaded from the v5 MakeCode editor.
To Reproduce Steps to reproduce the behavior:
- Use this file: microbit-d_DataLogging-Tutorial.zip
- Open it in the current v5 MakeCode editor.
- Try to save or download the program
- See error:
error: pxt_modules/pxt-kitronik-air-quality/main.ts(1,1): error TS9200: program too big by 2500 bytes!
pxtapp.js:1 warning: program too big by 2500 bytes!
Expected behavior It should download with no issues. This expected behaviour can be seen by carrying out the previous steps in the v4 editor.
This is presumably related to https://github.com/microsoft/pxt-microbit/issues/4788 which is included in https://github.com/microsoft/pxt-microbit/milestone/4.
In case this means something... I noticed that the example has extension v0.1.1. When updated, it becomes v1.0.12, and the "too big" number increases to 3220.
As an alternative to using MakeCode V4, it will build for V2 only, if the V1 build is disabled by editing the settings text like https://github.com/microsoft/pxt-microbit/issues/3864#issuecomment-1168420354
@martinwork Looking at those other issues, this does appear to be the same thing as https://github.com/microsoft/pxt-microbit/issues/4788.
With regards to the extension version numbers, we just made some updates to the extension since the example program was written - however, the example program still downloads in the v4 editor when the extension version is updated to the latest one.
The product this extension supports already has 2 extension versions: one for V2 only as it was too large for V1, and one which is compatible for all microbits. This example program needs to work with V1 microbits, so disabling it in settings is not an option.
Are there any current work arounds for this issue? I have recently got a Kitronik Air Quality board, but I am not able to build a data logger without over shooting the memory usage. Even the simplest cut down version of the tutorial for data logging fails:
input.onButtonPressed(Button.A, function () {
kitronik_air_quality.sendAllData()
})
kitronik_air_quality.setupGasSensor()
kitronik_air_quality.calcBaselines()
loops.everyInterval(5000, function () {
kitronik_air_quality.measureData()
kitronik_air_quality.logData()
})
@AlasdairAtKitronik, we found the regression and made a fix to our compiler backend. The fix will be available in the v6 editor, currently live in the beta channel (https://makecode.microbit.org/beta).
Thanks for reporting!