Update : 2021/Oct/17
-
Earlier title was misleading, it said Migrating from GatsbyJS 3 to GatsbyJS4, now i have corrected that and put in the right version.
-
After upgrading Gatsby to 3.14.2 and gatsby-theme-minimal-blog to commit
c40bd5e
, the slowness issue mentioned below is resolved.
Note: Not changing the link-name as it could lead to a 404.
Basically the intention was not to migrate but to add following features to the existing site and while executing Gatsby CLI commands saw there was a new version available. So why not ? thats how it started.
- Upgrade to Google Analytics 4 as i have been getting emails from Google - Success
- Wanted to add Latex Support to the site as i wanted to showoff some math stuff - Failed
- Add Table of Content plugin - Failed
What did i do
- Upgraded NodeJS from v10.16.3 to v14.17.3 ( typical windows installation )
- Upgraded NPM from 6.11.3 to 7.20.0
npm -g uninstall npm
npm -g i npm
- Upgraded gatsby-cli from 2.16.2 to 3.9.0
npm -g uninstall gatsby-cli
npm -g i gatsby-cli
-
Created a new folder
bdv3g3
, went in and cloned
git clone https://github.com/LekoArts/gatsby-starter-minimal-blog.git
-
Went into the folder and did
npm install --legacy-peer-deps
as per instructions in README.md -
After installs tried
gatsby develop --verbose
it failed with below messages.
- Ran
npm outdated
- Ran npm to update all the outdated packages forcefully like below to see what happens as i couldn’t get any workable results even after couple of hours, googling and S.O
NPM should develop an easy command to forcefully upgrade all the dependent packages
After this forceful update, to my surprise, there were no errors.
Now to the main goals
-
Failed : Wanted to add Latex Support to the site as i wanted to showoff some math stuff. Tried
- Plugins : gatsby-remark-katex
- Plugins : gatsby-remark-mathjax
- User Sixian Li using the same starter pack has done it. Tried it out but it didn’t work for me.
- Tried approach mentioned in Gatsbyjs with MDX and Latex Equations
- Read many other articles nothing worked. Giving up
-
Success : Upgrade to Google Analytics 4
- Installed plugin
npm install gatsby-plugin-google-gtag
from gatsby-plugin-google-gtag
- Watched this youtube video GatsbyJS & GA4: Upgrading a Gatsby Site to Google Analytics 4
- Followed the instructions in the gatsbyJS website to get the new gtag configured. In the
gatsby-config.js
, need to add measurement id which needs to be retreived from Google Analytics site.
- Installed plugin
-
Failed : Add Table of Content plugin. Tried
- Table of Contents in Gatsby
- Read few other articles. Giving up
This whole thing wasted 2 days of my time.
Wish LekoArts adds following to this starter pack
- Latex support
- Table of Contents
Gatsby Experience 3.9.0
gatsby build --verbose
- Build time increased by 10mins. Earlier it was 10mins now its 22mins and taking lots of memory than usual enough to restart the computer.
gatsby develop --verbose
- Every page click browsing within the site, is taking long time to process. Earlier it doesn’t take time unless that page is updated.