— time-wasted, gatsbyjs — 2 min read
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.
1npm -g uninstall npm2npm -g i npm
1npm -g uninstall gatsby-cli2npm -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.
1ERROR #98124 WEBPACK2
3Generating development SSR bundle failed4
5Can't resolve '@reach/router/lib/utils' in 'D:\BigData\08. HTML\Gatsby\lupin\bdv3g3\gatsby-starter-minimal-blog\.cache'6
7If you're trying to use a package make sure that '@reach/router/lib/utils' is installed. If you're trying to use a local file make sure that the path is correct. 8
9File: .cache\find-path.js10
11
12 ERROR #98124 WEBPACK13
14Generating development SSR bundle failed15
16Can't resolve 'gatsby-link' in 'D:\BigData\08. HTML\Gatsby\lupin\bdv3g3\gatsby-starter-minimal-blog\.cache'17
18If you're trying to use a package make sure that 'gatsby-link' is installed. If you're trying to use a local file make sure that the path is correct.19
20File: .cache\gatsby-browser-entry.js21
22
23 ERROR #98124 WEBPACK24
25Generating development SSR bundle failed26
27Can't resolve 'gatsby-react-router-scroll' in 'D:\BigData\08. HTML\Gatsby\lupin\bdv3g3\gatsby-starter-minimal-blog\.cache'28
29If you're trying to use a package make sure that 'gatsby-react-router-scroll' is installed. If you're trying to use a local file make sure that the path is 30correct.31
32File: .cache\gatsby-browser-entry.js33
34not finished Building development bundle - 13.588s
npm outdated
1D:\BigData\08. HTML\Gatsby\lupin\bdv3g3\gatsby-starter-minimal-blog>npm outdated2Package Current Wanted Latest Location Depended by3@lekoarts/gatsby-theme-minimal-blog 2.7.6 2.7.6 3.0.2 node_modules/@lekoarts/gatsby-theme-minimal-blog gatsby-starter-minimal-blog4gatsby 2.32.13 2.32.13 3.9.1 node_modules/gatsby gatsby-starter-minimal-blog5gatsby-plugin-feed 2.13.1 2.13.1 3.9.0 node_modules/gatsby-plugin-feed gatsby-starter-minimal-blog6gatsby-plugin-gatsby-cloud 1.0.2 1.0.2 2.9.1 node_modules/gatsby-plugin-gatsby-cloud gatsby-starter-minimal-blog7gatsby-plugin-google-analytics 2.11.0 2.11.0 3.9.0 node_modules/gatsby-plugin-google-analytics gatsby-starter-minimal-blog8gatsby-plugin-manifest 2.12.1 2.12.1 3.9.0 node_modules/gatsby-plugin-manifest gatsby-starter-minimal-blog9gatsby-plugin-netlify 2.11.1 2.11.1 3.9.0 node_modules/gatsby-plugin-netlify gatsby-starter-minimal-blog10gatsby-plugin-offline 3.10.2 3.10.2 4.9.0 node_modules/gatsby-plugin-offline gatsby-starter-minimal-blog11gatsby-plugin-sitemap 2.12.0 2.12.0 4.5.0 node_modules/gatsby-plugin-sitemap gatsby-starter-minimal-blog
1npm install @lekoarts/gatsby-theme-minimal-blog@latest gatsby@latest gatsby-plugin-feed@latest 2gatsby-plugin-gatsby-cloud@latest gatsby-plugin-google-analytics@latest gatsby-plugin-manifest@latest gatsby-plugin-netlify@latest gatsby-plugin-offline@latest gatsby-plugin-sitemap@latest --force
NPM should develop an easy command to forcefully upgrade all the dependent packages
After this forceful update, to my surprise, there were no errors.
Failed : Wanted to add Latex Support to the site as i wanted to showoff some math stuff. Tried
Success : Upgrade to Google Analytics 4
npm install gatsby-plugin-google-gtag
from gatsby-plugin-google-gtag1npm uninstall gatsby-plugin-google-analytics2# Remove related section from gatsby-config.js -> plugins3npm install gatsby-plugin-google-gtag4# Update the code mentioned in the gatsby plugin site
gatsby-config.js
, need to add measurement id which needs to be retreived from Google Analytics site.Failed : Add Table of Content plugin. Tried
This whole thing wasted 2 days of my time.
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.