Error using new `gatsby-starter-shopify` with `gatsby-source-sanity` plugin.
See original GitHub issueDescription
Hi folks.
I’ve just started rebuilding a Shopify site and I wanted to use the Shopify starter (gatsby-starter-shopify
) as a starting point.
The old site is also a Gatsby site, but it is using the old Shopify plugin, and using Sanity as the CMS for everything but product data.
I tried adding the gatsby-source-sanity
plugin to start working with the data from the CMS, but unfortunately I’m unable to spin up a dev server.
Steps to reproduce
I’ve put this in an example repo for easy reference here: https://github.com/lukebennett88/gatsby-starter-shopify-with-sanity
I haven’t done anything to gatsby-starter-shopify
repo other than:
- Install
gatsby-source-shopify
- Update
.env
file - Commit lockfile
So it should be pretty easy to get the same error.
Expected result
I’d like to be able to use both the Shopify and the Sanity source plugin together.
Actual result
Here is the output after running npm run start
:
Missing onError handler for invocation 'building-schema', error was 'Error: Schema must contain uniquely named
types but contains multiple types named "GatsbyImageLayout".'. Stacktrace was 'Error: Schema must contain uniquely
named types but contains multiple types named "GatsbyImageLayout".
at new GraphQLSchema
(/gatsby-starter-shopify/node_modules/graphql/type/schema.js:194:15)
at SchemaComposer.buildSchema
(/gatsby-starter-shopify/node_modules/graphql-compose/lib/SchemaComposer.js:179:12)
at buildSchema
(/gatsby-starter-shopify/node_modules/gatsby/src/schema/schema.js:76:33)
at build (/gatsby-starter-shopify/node_modules/gatsby/src/schema/index.js:105:18)
at buildSchema
(/gatsby-starter-shopify/node_modules/gatsby/src/services/build-schema.ts:19:3)'
⠸ building schema
Environment
System:
OS: macOS 11.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Shell: 3.2.0 - /usr/local/bin/fish
Binaries:
Node: 14.16.1 - /var/folders/db/sb6c_fwd5ld6wrcjyzp7dv2w0000gn/T/fnm_multishells/37342_1621750805315/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.13.0 - /var/folders/db/sb6c_fwd5ld6wrcjyzp7dv2w0000gn/T/fnm_multishells/37342_1621750805315/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Safari: 14.1
npmPackages:
gatsby: ^3.4.1 => 3.5.1
gatsby-plugin-gatsby-cloud: ^2.4.1 => 2.5.0
gatsby-plugin-google-analytics: ^3.4.0 => 3.5.0
gatsby-plugin-image: ^1.4.0 => 1.5.0
gatsby-plugin-react-helmet: ^4.4.0 => 4.5.0
gatsby-plugin-sharp: ^3.4.1 => 3.5.0
gatsby-plugin-sitemap: ^4.0.0 => 4.1.0
gatsby-source-filesystem: ^3.4.0 => 3.5.0
gatsby-source-sanity: ^7.0.4 => 7.0.4
gatsby-source-shopify: rc => 5.0.0-rc.23
gatsby-transformer-sharp: ^3.4.0 => 3.5.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
hi @LekoArts
I’ve got a similar but different issue:
is this related at all? I’m trying to upgrade to Gatsby 4, the latest vs of GSS, and also GS-wordpress.
I’ve had a deep google and run through some source code… but I am completely stumped.
Hey, thanks for the issue!
This is an issue with the Sanity plugin: https://github.com/sanity-io/gatsby-source-sanity/issues/122 Similarly to https://github.com/gatsbyjs/gatsby/pull/30834 they’ll need to fix their plugin.