[Storage Analyzer] Unable to decode "", got SyntaxError.
Affected hardware version
Bangle 2, Bangle 1
Your firmware version
2v27
The bug
When using the Storage Analyzer app, it does not give the data in a table and pie chart, instead it hangs on the reading storage screen, and then displays an error message at the bottom of the app loader saying this: Eval from app loader failed: Unable to decode "", got SyntaxError: Unexpected end of JSON input.
I'm wondering whether or not i's my own bangle, or if it's an app problem, because I remember it working fine before. Whoever sees this, could you run a quick test and just open the storage analyser app in the app loader and see if it works as intended? That will help us figure out if it's a watch side problem, or app problem. Thanks!
Installed apps
antonclk (0.11), widlock (0.08), notify (0.14), boot (0.66), sched (0.33), alarm (0.52), mylocation (0.11), clkinfosunrise (0.05), worldclkinfo (0.01), kbmulti (0.09), tictactoe (0.03), stacker (0.03), f9lander (0.04), messageicons (0.09), reply (0.03), widmessages (0.07), messages (0.67), locale (0.20), files (0.08), calculator (0.08), widbthide (0.01), bordle (0.03), chess (0.06), loadingscreen (0.01), kineticscroll (0.05), sleeplog (0.20), clockbg (0.07), pebblepp (0.11), clkinfocal (0.05), widanclk (0.03), barometer (0.04), 2047pp (0.04), clkshortcuts (0.01), astrocalc (0.09), zambretti (0.01), themes (0.01), qmsched (0.10), widbattpwr (0.03), messagegui (0.88), clkinfostopw (0.03), wid_edit (0.05), guitar (0.03), clkinfosec (0.02), taglaunch (0.08), smartbatt (0.01), myprofile (0.02), clkinfodist (0.01), autoreset (0.02), widram (0.03), activityreminder (0.12), swatch (0.07), stlap (0.04), ctrlpad (0.02), setting (0.81), health (0.37), backlite (0.02), powermanager (0.13), magnav (0.07), ios (0.21), banglexercise (0.06), modclock (0.05), weather (0.30), clock_info (0.20), popconlaunch (0.05)
I know I have a lot of apps... But that shouldn't affect the analyser, my storage is only 15% used...
Worked ok for me, I suspect there's a wrong assumption in the analyser. In the browser console is there a backtrace along with the error? (hit F12 to see it)
Here is my backtrace, maybe similar to OP:
================================================ Type 'Comms.debug()' to enable Comms debug info ================================================ GET window.localStorage = null Initialising Notifications espruinotools.js:54 Initialising Status espruinotools.js:54 Initialising Utils espruinotools.js:54 Initialising Config espruinotools.js:54 Initialising Serial espruinotools.js:54 Initialising CodeWriter espruinotools.js:54 Initialising Modules espruinotools.js:54 Initialising Env espruinotools.js:54 Initialising Terminal espruinotools.js:54 Initialising Compiler espruinotools.js:54 Initialising Assembler espruinotools.js:54 Initialising GetGitHub espruinotools.js:54 Initialising Minify espruinotools.js:54 Initialising CoreModules espruinotools.js:54 Initialising Pretokenise espruinotools.js:54 Initialising SaveOnSend espruinotools.js:54 Initialising SetTime loader.js:314 lang/de_DE.json loaded successfully pwa.js:5 ¿? beforeinstallprompt BeforeInstallPromptEvent uart.js:919 Web Bluetooth is experimental on this platform. See https://github.com/WebBluetoothCG/web-bluetooth/blob/main/implementation-status.md context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path uart.js:1308 <UART> Device Name: Bangle.js 08b4 uart.js:1308 <UART> Device ID: PIPXlCZEKjHOjP+ov3W9cQ== uart.js:1308 <UART> Connected comms.js:370 <COMMS> Ctrl-C gave "" context-menu-content-scripts.js:25 Using workaround to get event.path comms.js:464 <COMMS> getDeviceInfo Object index.js:1075 Current device time is Tue Aug 26 2025 17:52:16 GMT+0200 (Mitteleuropäische Sommerzeit) context-menu-content-scripts.js:25 Using workaround to get event.path index.js:268 IFRAME loaded index.js:353 Adding Comms.on('data') handler for iframe customize.js:187 <CUSTOM> init message received Object context-menu-content-scripts.js:25 Using workaround to get event.path uart.js:1308 <UART> Unable to decode "", got SyntaxError: Unexpected end of JSON input ui.js:76 <TOAST>[error] Eval from app loader failed: Unable to decode "", got SyntaxError: Unexpected end of JSON input index.js:285 Unable to decode "", got SyntaxError: Unexpected end of JSON input (anonymous) @ index.js:285 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 setTimeout timeout @ uart.js:1236 context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path context-menu-content-scripts.js:25 Using workaround to get event.path
So by the looks of it, you also have the same problem... @bobrippling @nxdefiant could both of you share the apps installed, so we can see if any patterns are there? My backtrace looks identical to @nxdefiant 's
Also if you can, share storage stats (free, used, trash). That might have something to do... I tried backing up and factory resetting my watch, and it worked perfectly then, restored the backup and the problem is back.
My table is this - @nxdefiant & @RKBoss6, what about yours?
| App | Code (kb) | Data (kb) | Total (kb) |
|---|---|---|---|
| recorder | 19.9 | 83.7 | 103.6 |
| boot | 29.4 | 22.2 | 51.6 |
| runplus | 36.8 | 0.3 | 37.0 |
| setting | 23.3 | 0.9 | 24.2 |
| messagegui | 22.9 | 0.0 | 22.9 |
| alarm | 16.9 | 0.0 | 16.9 |
| sched | 15.4 | 1.5 | 16.9 |
| powermanager | 10.1 | 5.0 | 15.1 |
| slopeclockpp | 14.8 | 0.0 | 14.8 |
| rep | 13.7 | 1.0 | 14.7 |
| pace | 12.7 | 0.0 | 12.7 |
| kbmulti | 12.0 | 0.1 | 12.1 |
| health | 11.2 | 0.0 | 11.2 |
| android | 11.0 | 0.1 | 11.1 |
| bikespeedo | 9.8 | 0.0 | 9.8 |
| clock_info | 9.6 | 0.1 | 9.7 |
| promenu | 9.1 | 0.0 | 9.1 |
| messageicons | 9.1 | 0.0 | 9.1 |
| dedreckon | 8.5 | 0.0 | 8.5 |
| dtlaunch | 6.6 | 1.6 | 8.2 |
| counter2 | 7.9 | 0.1 | 8.0 |
| noteify | 7.9 | 0.0 | 7.9 |
| messages | 7.6 | 0.2 | 7.8 |
| drained | 7.5 | 0.1 | 7.6 |
| terminal | 7.6 | 0.0 | 7.6 |
| hadash | 6.3 | 1.2 | 7.5 |
| smpltmr | 6.3 | 0.0 | 6.3 |
| datetime_picker | 5.3 | 0.0 | 5.3 |
| widdst | 5.1 | 0.2 | 5.2 |
| magnav | 5.0 | 0.1 | 5.1 |
| stopwatch | 5.0 | 0.1 | 5.1 |
| widalarmeta | 4.8 | 0.1 | 4.9 |
| hasscontrol | 4.3 | 0.0 | 4.3 |
| tally | 3.6 | 0.1 | 3.7 |
| hidmsicswipe | 2.9 | 0.0 | 2.9 |
| qrcode | 2.6 | 0.0 | 2.6 |
| chimer | 2.4 | 0.1 | 2.5 |
| notify | 2.5 | 0.0 | 2.5 |
| widmessages | 2.1 | 0.0 | 2.1 |
| mylocation | 2.0 | 0.0 | 2.0 |
| reply | 1.6 | 0.0 | 1.6 |
| widdevst | 1.4 | 0.0 | 1.4 |
| chargerot | 1.3 | 0.0 | 1.4 |
| clkinfostopw | 1.3 | 0.0 | 1.3 |
| hwid_a_battery_widget | 1.1 | 0.0 | 1.1 |
| clkinfomag | 1.0 | 0.0 | 1.0 |
| widbtstates | 0.9 | 0.0 | 0.9 |
| widlockunlock | 0.8 | 0.0 | 0.8 |
| widclk | 0.8 | 0.0 | 0.8 |
Free: 41.9% Used: 13.8% Trash: 44.3%
Since I can't access the table, here's my app list: antonclk (0.11), widlock (0.08), notify (0.14), boot (0.66), sched (0.33), alarm (0.52), mylocation (0.11), clkinfosunrise (0.05), worldclkinfo (0.01), kbmulti (0.09), tictactoe (0.03), stacker (0.03), f9lander (0.04), messageicons (0.09), reply (0.03), widmessages (0.07), messages (0.67), locale (0.20), files (0.08), calculator (0.08), widbthide (0.01), bordle (0.03), chess (0.06), loadingscreen (0.01), kineticscroll (0.05), sleeplog (0.20), clockbg (0.07), pebblepp (0.11), clkinfocal (0.05), widanclk (0.03), barometer (0.04), 2047pp (0.04), clkshortcuts (0.01), astrocalc (0.09), zambretti (0.01), themes (0.01), qmsched (0.10), widbattpwr (0.03), messagegui (0.88), clkinfostopw (0.03), wid_edit (0.05), guitar (0.03), clkinfosec (0.02), taglaunch (0.08), smartbatt (0.01), myprofile (0.02), clkinfodist (0.01), autoreset (0.02), widram (0.03), activityreminder (0.12), swatch (0.07), stlap (0.04), ctrlpad (0.02), setting (0.81), health (0.37), backlite (0.02), powermanager (0.13), magnav (0.07), ios (0.21), banglexercise (0.06), modclock (0.05), weather (0.30), clock_info (0.20), popconlaunch (0.05)
@RKBoss6, @nxdefiant, would you mind trying out the linked gh-pages from my PR, let me know what outcome you get
I still get the error
Cool - do you see the same error if you turn on "File Upload Compatibility mode" in the app loader before connecting? And are there any apps listed at all or is it exactly the same error?
I tried with and without the file upload compatibility, the same error came both times: Eval from app loader failed: Unable to decode "", got SyntaxError: JSON Parse error: Unexpected EOF
Ok, so something's preventing the code from executing at all. Can you run it with the IDE connected in another tab and paste in the console contents of the IDE afterwards?
This is fun, while the IDE is connected it works for me - I get a result
Reproduced it three times.
This is fun, while the IDE is connected it works for me - I get a result
Could be a bug with the new UART protocol and the comms lib is switching over to the (working) older text-based protocol with the IDE interfering. @gfwilliams does that sound like a possibility?
I don't think it could be anything to do with the protocol - the app loader doesn't have a way of knowing whether the IDE is connected.
I could be:
- IDE connection has sent some data and that forces the BLE connection into the high speed mode when maybe it wasn't before
- There's something on the REPL input line (or maybe some app running that keeps printing stuff to the console and messes up the parsing out of the data)
Could you try Comms.debug() in the chrome console before you load the storage analyser, and then post up what's printed? You'll probably need to attach as it could be a lot
Here we go: banglejs.com-1756726041183.log
Ok, thanks. So I'm pretty sure the issue is it just timed out waiting for a response, because it took so long to scan all the files.
It's possible that UART.timeoutNewline could be increased (but it's already 10 seconds) - I think that's the one, but it might be a different timeout value that's used.
Maybe a better option might be to split the code in the HTML up, so it iterates over all apps and the runs eval for each app's files in turn. It'll be slower for everyone, but at least you could get a progress bar and it wouldn't cause a problem if someone had a load of apps.
Yeah (I suspect) that was the issue - I rewrote it to run the eval for each app instead. @nxdefiant, @RKBoss6 would you mind re-testing?
The only trouble now is that there's a progress bar for each Puck.eval() instead of for the whole thing, is it possible to override perhaps?
Ok, it works now, but at an approximate of 1 minute eval time... Could that be shortened possibly? The progress bar for each file is a bit off putting, but might be fine. @gfwilliams is there a way to override it, or display a manual progress bar?
Thanks though, @bobrippling, everything else works as it should :)
at an approximate of 1 minute eval time... Could that be shortened possibly?
Yeah we could batch things up / run a bit more code on the Bangle. I'll see what Gordon thinks about the progress bar first
It basically works, but at the bottom it prints
Error in app "waternet.info": TypeError: Assignment to constant variable. Error in app "trex.info": TypeError: Assignment to constant variable.
It basically works, but at the bottom it prints
Error in app "waternet.info": TypeError: Assignment to constant variable. Error in app "trex.info": TypeError: Assignment to constant variable.
Thanks - fixed
Thanks for looking into this!
The only trouble now is that there's a progress bar for each Puck.eval() instead of for the whole thing, is it possible to override perhaps?
In the main app loader you can do progress with sticky:true but I don't know if you can do that from the iframe? Splitting up into multiple eval calls per app will always be quite slow though.
Before, we had:
Puck.eval(`(()=>{
let getApps = () => require("Storage").list(/\\.info$/).map(appInfoName => {
let appInfo = require("Storage").readJSON(appInfoName,1)||{};
but rather than re-writing it to use a bunch of evals, you could just do:
Puck.eval(`require("Storage").list(/\\.info$/)`).forEach(appInfoName => {
Puck.eval(`let appInfo = require("Storage").readJSON(${JSON.stringify(appInfoName)},1)||{};
....`)
....
So it gets a list of app infos, then does one eval per app? To speed things up you could even do:
let appInfos = Puck.eval(`require("Storage").list(/\\.info$/)`);
for (var i=0;i<appInfos.length;i+=5)
Puck.eval(`(()=>{
let getApps = () => ${JSON.stringify(appInfos.slice(i,i+5))}.map(appInfoName => {
let appInfo = require("Storage").readJSON(appInfoName,1)||{};
so it's the same main code as before, just with 5 apps at a time?
Do we have any update for this as of right now? The gh-pages doesn't seem to be up right now...
Ah no - I haven't gone back to the PR (#3983). If you wanted to add Gordon's suggested changes to it I'd be happy to merge your changes into my branch :)
Sure, I'll try that! Would you mind setting up your github pages so I can see what we currently have? Thanks!
Of course, let me know if you hit any problems too - deployed here
Looks good