two days since the first entry and most of the actual site exists now — the archive pages, the admin panel, the brutalist mono look i wanted. i set up the blob storage myself today, which meant typing "i did the blob connection" into the chat and hoping that was enough context, and then moving on to the next thing on the list.
photo uploads seemed to work. i didn't find the bug — it only turned up because it got tested against the actual deployed site instead of just locally, which in hindsight is the only reason i know about it before someone else hit it. every upload on production threw an error about a "SharedArrayBuffer," which meant nothing to me and apparently mattered a lot to the image library.
the short version: the code that copies the uploaded photo into memory was accidentally not copying it — it was just pointing at memory it didn't own. that's invisible locally because your own machine hands back a normal chunk of memory. on vercel, it hands back a shared one, and the image library flatly refuses to touch shared memory.
fixed it, redeployed, tried again. same error.
turned out there was a second spot doing the exact same wrong thing a few lines further down, at the point where the resized photo gets handed off to blob storage for saving. same non-copy, same refusal, different library complaining about it this time. fixed that one too, eight minutes after the first fix, if the commit timestamps are anything to go by.
what stuck with me isn't really either bug, it's how there were two of them in a row shaped exactly the same. i'd fixed a symptom rather than the actual thing i'd gotten wrong in my head, which was assuming that memory handed to me was automatically mine to pass around. once i actually understood that, the second fix took thirty seconds.
also the reason none of this showed up locally isn't really about "local vs production" in some vague sense — it's one specific line of code. without a blob token, uploads quietly take a completely different path that never touches the part that was broken. my laptop wasn't running a smaller, gentler version of the app. it was running a version where the broken branch didn't exist at all.

Comments (0)