Migrating my website to gatsby v2

February 05, 2019 gatsbyjs GatsbyJS

Hi, I was tweaking my articles pages when I decided its time to migrate to version 2 of the awesome static site generator Gatsby.

Their migration guide was self explanatory, I started by :

* Updating Gatsby version

* Updating Gatsby related packages

* Installing React and React Dom

But when running gatsby I got some dependencies error, I thought it was because I had forget to install some plugins peer dependencies but I was wrong.

The solution was to delete the node_modules folder and package-lock.json file.

Then another bug appeared :
Error: Unable to find plugin "gatsby-plugin-react-next". Perhaps you need to install its package?

This time I had to remove that plugin from gatsby-config file.

I followed the next steps like refactoring layout component, changing navigateTo to navigate … and now my website is finally updated to v2.

Conclusion : the steps are easy and well explained but they can require some time to be completed.