pxt icon indicating copy to clipboard operation
pxt copied to clipboard

better treatment of packages that depend on beta (versioning mismatch)

Open thomasjball opened this issue 1 year ago • 1 comments

Try the following:

  1. load https://github.com/microbit-apps/pxt-arcadeshield in https://makecode.microbit.org/beta (WORKS)
  2. 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.

thomasjball avatar Nov 25 '24 19:11 thomasjball

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])
            }

tballmsft avatar Nov 25 '24 19:11 tballmsft