A saved value shows late on a prerendered page
The message
MARKLESS_STORAGE_FIRST_PAINT_UNPREPARED: on the prerendered page <value>, <where> <why> from storage('<key>'), so a visitor with a saved value sees the starting value until the page wakes. To show the saved value in the first frame, <instead>.Words in angle brackets change from case to case.
Why
A page built ahead of time is rendered with the starting value. For every spot that shows the saved value, Markless works out from your code what the spot shows for each value, and the page fills it in while it loads, before anything is painted. It can do that when the code uses the value as it is, compares it with fixed strings, or looks it up in a fixed object. It cannot when the code changes the value into something new (mode.toUpperCase(), a template string), passes it to a function, mixes it with another changing value, or builds a @for list from it. That spot shows the starting value until the page wakes and corrects it, a moment later.
Fix
Compare the value with fixed strings: mode === 'night' ? 'NIGHT' : 'DAY' instead of mode.toUpperCase(), or look it up: ({ night: 'Moon', day: 'Sun' })[mode]. For rows that depend on the value, show them with @if arms. The page still works as written; only the first frame differs.
Related
Where Markless raises it
Button sounds are from Josh Comeau's Button Sounds library.