Urgent fix in my Site due to gatsby-link changes

Image for post
Image for post
Photo by Taylor Vick on Unsplash

I had recently factory reset my mac, as it had become very slow. So, i had to download the code to my production site https://thewebdev.tech/ again from my private github repo.

After that i added some new posts, but was not able to open them from the series. Click on any link inside any series like http://localhost:8000/series/Gatsby-firebase

Image for post
Image for post
Series

It was taking to http://localhost:8000/series/Gatsby-firebase/gatsby-firebase-1 which was not there and hence was giving error. Instead it should have take to http://localhost:8000/gatsby-firebase-1

As i didn’t changed any of my code, so i contacted the friendly Gatsby support on there spectrum chat. You can read more about the issue here.

As always they were quick to identify the problem and it was due to some changes in gatsby-link that was using relative paths. So, i had to change <Link to={slug}> to <Link to={`/${slug}`}>

I did the same in two file — series-template.js and tags-template.js

Image for post
Image for post
The fix

It resolved the issue and the commit details from my pre-prod can be found in the below link.

As always i want to document every changes which i do to my production site https://thewebdev.tech/

Written by

UI Lead- ReactJS, JavaScript and everything in-between.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store