You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
close-meIf there is no new activity on the issue, it will be closed after a few months.software: pybricks-codeIssues with https://code.pybricks.com application
changed the title [-][Bug] ValueError: incompatible .mpy file on Microsoft Edge Browser Pybricks Code v1.0.0-beta.9[/-][+][Bug] ValueError: incompatible .mpy file on Windows Pybricks Code v1.0.0-beta.9[/+]on Apr 6, 2021
[EDIT almost all as this escaped to me]
Microsoft Edge Versie 89.0.774.68 (Officiële build) (64-bits)
using updated beta-10 running repeated this program (kept pressing "run"):
from pybricks import version
from pybricks.tools import wait
from pybricks.tools import StopWatch
print()
print(version)
got this result (trimmed a few identical entries from the top):
I think I found yet another race condition caused by the fix I just made. If the program ends too quickly, we miss the user program running status flag, and Pybricks Code gets stuck with the run button disabled.
I think I found yet another race condition caused by the fix I just made. If the program ends too quickly, we miss the user program running status flag, and Pybricks Code gets stuck with the run button disabled.
Should have opened a new issue for this, but it is fixed now in v1.0.0-beta.12
As mentioned in #283 (comment), I still had ValueError: incompatible .mpy file show up for me sometimes on both Windows and Linux, Chrome and Edge. Once it showed up, I could only fix it by restarting the browser. I used Pybricks code beta.12 with the firmware that it installs by default.
I did some superficial testing just now, I didn't update pybricks code just yet (had the "restart to update" popup showing).
On chrome I started and stopped my program a few times. At some point in this process, the hub seemingly crashes (continuous LED, not responsive to button presses). When that happens I am always forced to shut down the hub via long pressing the button, which still works. Upon turning it on again, I could reconnect and start the program without problem.
Upon switching to Edge, I did the same, starting and stopping my program a few times. At some point the hub similarly freezed up again. Upon restarting the hub there, I had the incompatible .mpy file error show up. Like previously, this persists even when reconnecting the hub.
Now I just tested it on Edge using beta.13. After connecting, I started the program (the same as in the pastebin from the other issue), which runs without issue. After pressing the stop button on pybricks code, the hub became unresponsive. When pressing run after that, it is greyed out for 1-2 seconds and then is enabled again, but no message shows up in the terminal. I could reproduce it one more time, but now I tried a few more times and starting and stopping seems to work without problem now. I will have more time for testing tomorrow.
Thanks. Sounds like we finally (:crossed_fingers:) got the Pybricks Code issues sorted out. The hub freezing sounds like it could be a memory corruption issue in the firmware.
It is still possible to get ValueError: incompatible .mpy file if you press a key when the terminal is in focus and a program is not running(#303) and if that same error message is caused by something else, it is probably a new bug, so closing this one.
close-meIf there is no new activity on the issue, it will be closed after a few months.software: pybricks-codeIssues with https://code.pybricks.com application
Activity
BertLindeman commentedon Apr 6, 2021
Tried
Google Chrome is up to date Version 89.0.4389.114 (Official Build) (64-bit)with this program:
And got:
Reduced the program by commenting out the first print line:
and got:
No idea where the leading "o" comes from . . . .
If I make the first print line shorter it does work.
E.G.
print("Just print version")No idea if it is related, messages from developer tools:

thesynman commentedon Apr 6, 2021
Same problems here using Win 10 and Chrome Version 89.0.4389.114 (Official Build) (64-bit)
dlech commentedon Apr 6, 2021
It is a checksum value that isn't supposed to be sent to the terminal.
[-][Bug] ValueError: incompatible .mpy file on Microsoft Edge Browser Pybricks Code v1.0.0-beta.9[/-][+][Bug] ValueError: incompatible .mpy file on Windows Pybricks Code v1.0.0-beta.9[/+]Fix failing download and run
dlech commentedon Apr 6, 2021
The fix for #287 caused this issue. v1.0.0-beta.10 is published now which should fix this issue.
BertLindeman commentedon Apr 6, 2021
[EDIT almost all as this escaped to me]
Microsoft Edge Versie 89.0.774.68 (Officiële build) (64-bits)
using updated beta-10 running repeated this program (kept pressing "run"):
got this result (trimmed a few identical entries from the top):
dlech commentedon Apr 6, 2021
So we can call it significantly improved, but not entirely fixed? 😄
BertLindeman commentedon Apr 6, 2021
Sure: no longer stable error. Another error?
Also occurs on Win10 Google Chrome.
disconnect / connect does not resolve this situation.
CTRL-F5 does resolve the problem.
Both browsers.
But problem can be recreated by running the program a few times (twice was enough now)
[-][Bug] ValueError: incompatible .mpy file on Windows Pybricks Code v1.0.0-beta.9[/-][+][Bug] ValueError: incompatible .mpy file Pybricks Code v1.0.0-beta.9[/+]Fix download and run race condition
dlech commentedon Apr 7, 2021
An additional fix is made in v1.0.0-beta.11.
dlech commentedon Apr 7, 2021
I think I found yet another race condition caused by the fix I just made. If the program ends too quickly, we miss the user program running status flag, and Pybricks Code gets stuck with the run button disabled.
dlech commentedon Apr 7, 2021
Should have opened a new issue for this, but it is fixed now in v1.0.0-beta.12
Novakasa commentedon Apr 11, 2021
As mentioned in #283 (comment), I still had
ValueError: incompatible .mpy fileshow up for me sometimes on both Windows and Linux, Chrome and Edge. Once it showed up, I could only fix it by restarting the browser. I used Pybricks code beta.12 with the firmware that it installs by default.dlech commentedon Apr 11, 2021
If you can figure out exact steps to reproduce the problem in beta 12, that would be helpful.
dlech commentedon Apr 12, 2021
Additional fixes have been made in beta 13, so hopeful that makes it so we can't get in a bad state that requires a browser restart.
Novakasa commentedon Apr 12, 2021
I did some superficial testing just now, I didn't update pybricks code just yet (had the "restart to update" popup showing).
On chrome I started and stopped my program a few times. At some point in this process, the hub seemingly crashes (continuous LED, not responsive to button presses). When that happens I am always forced to shut down the hub via long pressing the button, which still works. Upon turning it on again, I could reconnect and start the program without problem.
Upon switching to Edge, I did the same, starting and stopping my program a few times. At some point the hub similarly freezed up again. Upon restarting the hub there, I had the
incompatible .mpy fileerror show up. Like previously, this persists even when reconnecting the hub.dlech commentedon Apr 12, 2021
What was the exact version used for this test?
Novakasa commentedon Apr 12, 2021
That was beta.12.
Now I just tested it on Edge using beta.13. After connecting, I started the program (the same as in the pastebin from the other issue), which runs without issue. After pressing the stop button on pybricks code, the hub became unresponsive. When pressing run after that, it is greyed out for 1-2 seconds and then is enabled again, but no message shows up in the terminal. I could reproduce it one more time, but now I tried a few more times and starting and stopping seems to work without problem now. I will have more time for testing tomorrow.
dlech commentedon Apr 12, 2021
Thanks. Sounds like we finally (:crossed_fingers:) got the Pybricks Code issues sorted out. The hub freezing sounds like it could be a memory corruption issue in the firmware.
dlech commentedon Apr 13, 2021
It is still possible to get
ValueError: incompatible .mpy fileif you press a key when the terminal is in focus and a program is not running(#303) and if that same error message is caused by something else, it is probably a new bug, so closing this one.