user2371684
user2371684

Reputation: 1565

Upgrading Gatsby v4 to v5

I am using an Apple M1 Max processor and using MAC os Ventura 13.0.

I am on Node v18.12.1 (npm v8.19.2)

After using the

gatsby new

and setting up the site, it's installed to Gatsby 4, and React to 18.1.0 and after running this command:

npm install gatsby@next --legacy-peers-deps

I see that in my package.json file that Gatsby is now set to: 5.0.0-next.16.

Then running the command:

nvm install 18

I then run the command:

npm run develop

but then I run into the following error:

Missing onError handler for invocation 'building-schema', error was 'Error: Cannot create as TypeComposer the following value:
GraphQLScalarType({ name: "Date", description: "A date string, such as 2007-12-03, compliant with the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", specifiedByURL: undefined, serialize: [function String], parseValue: [function String], parseLiteral: [function parseLiteral], extensions: { }, astNode: undefined, extensionASTNodes: [] }).'. Stacktrace was 'Error: Cannot create as TypeComposer the following value:
GraphQLScalarType({ name: "Date", description: "A date string, such as 2007-12-03, compliant with the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", specifiedByURL: undefined, serialize: [function String], parseValue: [function String], parseLiteral: [function parseLiteral], extensions: { }, astNode: undefined, extensionASTNodes: [] }).

Is this an Apple silicon issue or am I missing something?

Upvotes: 5

Views: 1973

Answers (4)

Arbnor
Arbnor

Reputation: 2362

It worked for me when I simply installed graphql via yarn. Didn't know that my Gatsby project needed graphql in the dependencies. yarn add graphql fixed it.

Upvotes: 0

Cross
Cross

Reputation: 796

Multiple versions of either graphql or gatsby installed, especially for that kind of monorepo type projects.

Upvotes: 0

Abdullah Ceylan
Abdullah Ceylan

Reputation: 174

This is due to the multiple version of graphql installation. You need to add resolutions property to your package.json file for installing only one version of graphql.

  "resolutions": {
    "graphql": "16.0.0"
  }

https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v4-to-v5/#multiple-versions-of-graphql

Upvotes: 2

user2371684
user2371684

Reputation: 1565

Apparently, after I deleted the package-lock.json file and deleted the node_modules folder, I ran gatsby develop and this ran.

I have not figured out what the previous issue was, but it's working now.

Upvotes: 6

Related Questions