pxt
pxt copied to clipboard
better treatment of packages that depend on beta (versioning mismatch)
Try the following:
- load https://github.com/microbit-apps/pxt-arcadeshield in https://makecode.microbit.org/beta (WORKS)
- load https://github.com/microbit-apps/pxt-arcadeshield in https://makecode.microbit.org (FAILS, silently)
The WORKS and FAILS behaviors are expected, but the silent FAIL is not great. When there is a version mismatch (as above in (2)), we should have a nicer message.
The silent failure is here
pxtapp.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pxt.json')
at n.getConfigAsync (pxtapp.js:1:279221)
at pxtapp.js:1:285290
the code path is
if (!i.startsWith("pub:")) {
const s = e.patching.upgradePackageReference(t, n, i)
, r = e.appTarget.bundledpkgs[s];
return JSON.parse(r[e.CONFIG_NAME])
}