24
My first React app broke in 5 minutes on production
I spent 3 weeks building a little todo app in React for my portfolio. Deployed it to Netlify last Thursday and it crashed the second someone tried to add a task. Turns out I forgot to handle the case where localStorage is full or disabled. My error handling was just a console.log and a prayer. Did anyone else learn error handling the hard way after pushing to production? What do you actually check before you hit deploy?
3 comments
Log in to join the discussion
Log In3 Comments
murray.drew9d ago
Man, that first production crash is a rite of passage I swear. My first big project was a simple note-taking app (because we all need another one of those, right?) and it completely died when someone opened it in a browser with no localStorage support at all. Just a blank white screen of death and me frantically checking my console log like a madman. I now have a checklist I run through before deploy: test with localStorage disabled in dev tools, disable JavaScript for a sec to see what happens, and manually clear the storage to make sure my fallback state works. Still feel like I'm missing something obvious every time though.
8
ninas679d ago
Oh god, yes. That first crash is like getting punched in the gut. I still remember sitting there staring at a blank screen feeling my whole face go hot. You think you've covered everything, you tested on all your devices, but then reality hits and you realize you forgot about some edge case that makes your whole app just fall apart. Your checklist sounds solid though. I do the localStorage thing too and it saves my butt more often than I want to admit. It's funny how the stuff that seems so simple like note-taking can teach you the hardest lessons. You're not alone in that feeling of always missing something. I think that fear actually keeps us from making the same dumb mistakes twice.
1
yeah and the worst part is you probably spent like an hour testing it on your local machine, everything works great, you're feeling like a genius, and then boom. i had a similar thing happen where my app worked perfectly in chrome but completely exploded in safari because of some dumb api difference i didnt even know existed. now one thing i always do before deploy is literally turn off my wifi and see if the app still loads at all, because half the time it just hangs there like an idiot. also i check if the browser is actually from this decade because apparently people still use old internet explorer and i have to support it for some reason. does your checklist include testing on a slow connection with devtools throttling? that one caught me off guard pretty bad.
1