pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Makecode Offline App website not loading

Open MFHSchool opened this issue 3 months ago • 6 comments

Describe the bug The website https://makecode.microbit.org/offline-app has an infinite loading loop.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://makecode.microbit.org/offline-app
  2. Wait, the spinner is not replaced by the License Terms

Expected behavior The License Terms and download links should load

Screenshots Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome - Version 141.0.7390.54

Additional context The console shows Uncaught SyntaxError: Unexpected end of input (at offline-app:578:5) additionally to the usual error messages Uncaught SyntaxError: Unexpected identifier 'pxt' (at offline-app:877:179) and

Uncaught Error: Minified React error #299; visit https://reactjs.org/docs/error-decoder.html?invariant=299 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at n.createRoot (content.js:2:127887)
    at content.js:2:141096
    at content.js:2:141166
    at content.js:2:141169

Here is line 577 of offline-app.html:

h4.wrap('<div class="download-header"></div>'); } // Add recommendation space if it doesn't exist const header = segment.find(".download-header"); if (!header.find(".recommended-text, .recommended-space").length) { header.append('<div class="recommended-space"></div>'); } }); let recommendedButton = null; if (isMac) { if (isAppleSilicon) { recommendedButton = $("#download-macarm64"); } else { recommendedButton = $("#download-mac64"); } } else if (isWindows) { if (false && isWindowsARM) { recommendedButton = $("#download-winarm64"); } else { recommendedButton = $("#download-win64"); } } // Mark the recommended download if (recommendedButton && recommendedButton.length) { const segment = recommendedButton.closest(".ui.segment"); const space = segment.find(".recommended-space"); if (space.length) { space.replaceWith('<div class="recommended-text">Empfohlen</div>'); } } } function updateDownloadLinks(electronVersion) { $("#download-win64").attr("href", "https://makecode.com/api/release/microbit/" + electronVersion + "/win64"); $("#download-winarm64").attr("href", "https://makecode.com/api/release/microbit/" + electronVersion + "/winarm64"); $("#download-mac64").attr("href", "https://makecode.com/api/release/microbit/" + electronVersion + "/mac64"); $("#download-macarm64").attr("href", "https://makecode.com/api/release/microbit/" + electronVersion + "/macarm64"); } function downloadWin64() { window.pxtTickEvent("offlineapp.download", { "target": "microbit", "platform": "win64" }); } function downloadWinArm64() { window.pxtTickEvent("offlineapp.download", { "target": "microbit", "platform": "winarm64" }); } function downloadMac64() { window.pxtTickEvent("offlineapp.download", { "target": "microbit", "platform": "mac64" }); } function downloadMacArm64() { window.pxtTickEvent("offlineapp.download", { "target": "microbit", "platform": "macarm64" }); } $(function () { try { const urlParams = new URLSearchParams(window.location.search); const versionOverride = urlParams.get("version") || urlParams.get("v"); if (versionOverride && /^v\d+\.\d+\.\d+$/i.test(versionOverride)) { updateDownloadLinks(versionOverride); showAgree(); hideLoader(); return; } } catch (e) { console.warn("Could not parse search string", e); } $.getJSON("https://makecode.com/api/config/microbit/targetconfig") .then(function (data) { hideLoader(); if (data && data.electronManifest && data.electronManifest.latest) { updateDownloadLinks(data.electronManifest.latest); showAgree(); } else { showNoDownloads(); } }) .catch(function () { hideLoader(); showNoDownloads(); }) }); window.addEventListener('load', function () { $("#langpicker").remove(); });

It seems if the linebreaks were removed and hence the code is regarded as a comment

MFHSchool avatar Oct 03 '25 10:10 MFHSchool

@jwunderl ?

abchatra avatar Oct 03 '25 20:10 abchatra

I'm not certain where the react error is coming from, that page is plain html / javascript with just jquery that we serve from the docs themselves. Loading up the page / checking network response i see it as correct around that point:

Image

@MFHSchool is there any chance there's a browser extension impacting this / injecting content?

jwunderl avatar Oct 03 '25 20:10 jwunderl

I get the same error using a Chrome guest profile (which has no extensions) and in Microsoft Edge (with no extensions). When using Chrome on Android or Edge on Android, the License Terms load.

I also tried fetching the page with wget. Interestingly enough, when using wget https://makecode.microbit.org/offline-app -o offline-app.html the HTML file is fine and when opening in the browser (same browser as before), the License Terms are loaded.

MFHSchool avatar Oct 03 '25 21:10 MFHSchool

is the android device connected to the same network when making the requests? and is the device a school managed one?

getting the 'correct' response through wget but not in browser is very surprising / makes it seem to me as if something else could be impacting it -- if it's e.g. a firewall issue that is specific to requests from browser. If it's a school device, my understanding is that it's also possible to silently deploy e.g. security extensions even in guest profiles / hide them from the ui.

jwunderl avatar Oct 03 '25 21:10 jwunderl

I found the problem. The windows system is set to german, while the phone and wget pull the english version.

https://makecode.microbit.org/offline-app?lang=EN works in all browsers, while https://makecode.microbit.org/offline-app?lang=DE also has the same error on Android and with wget.

I believe this is also the problem in #6596, as I get the same error with https://makecode.microbit.org/offline-app?lang=ES

MFHSchool avatar Oct 03 '25 21:10 MFHSchool

Thanks @MFHSchool for figuring out the issue. We will investigate and try to address this.

abchatra avatar Oct 03 '25 21:10 abchatra