Week 4: Job Hunt
Last week I focused on the MERN stack, starting with React. On the surface it’s different, strange and slightly initimidating, but once you get stuck in it’s like riding a bike. React‘s job is to build user interfaces, and you do that by composing a bunch of components together.
Weather App: https://garethwoodman-weather-app.netlify.app/
At this time of writing I was excited to deploy my App via Netlify. However just because it worked in a Development Enviroment doesn’t mean it will be the same for Production!
The first error I came across: ‘Minified React error #152’. Checking the console doesn’t give much information, there was no specific line causing an error (just defaults to the beginning of the file). I was growing frustrated and had to get myself a Mint Tea to calm down.
Using my Google-Fu skills, I found this error translates to “Nothing was returned from Render”. The app was working 100% locally, all components loaded etc. So what on earth was causing the components not to render in Production?
One word, comments. Yes, I left comments inside my components and Production was having none of it, I removed any trace I could find and voila, the page finally loaded!
But I ran into another issue. The API key used to connect to the Weather API wasn’t being loaded by my enviroment variable. This one was a bit easier to solve, I only needed to explicity state my Enviroment Variables via my Netlify Build settings.
While these issues seemed minor I wasted a whole afternoon trying to get it working. But hey, atleast I’m going to have less headaches in future…
I’m a Software Developer looking for Full-Time work, please get in touch if you have a role available: https://garethwoodman.github.io/