Why building locally is important
Published: 04/17/2021 | Time To Read:2mins
I'm guilty. Last week I was working on my website on my laptop and testing as I went, but I was only running in dev mode, and it bit me in the butt. I had finished up a major refactor of my react-query hooks and types and all looked good, so I git pushed my code, and on my production server pulled, built, and restarted my app.
And then I found out it didn't work! Very quickly my website crashed because I didn't account for something in my code that would affect the production build on my website and because my laptop also stopped working had no live website for days!
The fix itself was very simple, but the fact that I didn't build it and test it locally was the problem. My CI builds have been broken for a while as well so I had no clue that it was even a problem! Double yikes!
My message today is simple, build your project locally before pushing life. Sentry is gonna let you know quickly that you messed up and if people are looking for your content well good luck! It doesn't take as long to check it as it would fix and redeploy.
Stay safe and build on!