geeksblabla.com icon indicating copy to clipboard operation
geeksblabla.com copied to clipboard

Migrate Project to latest Gatsby release

Open yjose opened this issue 3 years ago • 7 comments

Right now the project is using Gatsby v2 and we want to upgrade it to latest version

yjose avatar Jun 03 '22 20:06 yjose

Interested in this. Do you have an anti regression strategy ?

azihassan avatar Jul 22 '22 18:07 azihassan

Unfortunately no. will make sure to test the new implementation manually when every you have the chance to open a new PR Good luck and let me know if you need my help on something

yjose avatar Jul 23 '22 14:07 yjose

Thanks, I'll look into it. But just a heads up :

I tried to upgrade just now, and it looks like some packages need to be upgraded too.

For example, node-sass 4.13.0 didn't support node v16. Following this, I downgraded my node install to v13 (nvm is a lifesaver here). But then I ran into

error [email protected]: The engine "node" is incompatible with this module. Expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". Got "13.3.0"

I downgraded it further to v12 and got :

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=14.15.0". Got "12.22.12"

So it looks like breaking changes might be inevitable.

azihassan avatar Jul 23 '22 20:07 azihassan

Yeah please try to updates all deps to latest versions

yjose avatar Jul 23 '22 22:07 yjose

I briefly tested the deployed version and it looks OK

Just to be safe, I recommend that we try to deploy an episode using the upgraded code

azihassan avatar Jul 27 '22 17:07 azihassan

Quick update : still working on this. The gatsby-plugin-mdx 4.0.0 upgrade brought a bunch of breaking changes that I'm still trying to wrap my head around. The main problem I have is that it doesn't recognize frontmatter :

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Field "frontmatter" is not defined by type "MdxFilterInput".

File: gatsby-node.js:73:24



  GraphQLError: Field "frontmatter" is not defined by type "MdxFilterInput".

Right now gatsby-plugin-mdx is still in RC, but I remember reading that a stable version will be released this week. I'll look into it again once the stable version is out.

azihassan avatar Aug 14 '22 23:08 azihassan

Update : I tested the stable version a few days ago. The frontmatter error disappeared, but it doesn't recognize certain fields :

image

Commenting out the unrecognised fields causes the query to display the correct results.

Right now I'm still looking into why it fails for some fields and not others.

azihassan avatar Aug 25 '22 21:08 azihassan