Skip to content

New Build Errors #1

@JamieBradders

Description

@JamieBradders

Received a couple of emails from readers regarding build errors they are experiencing when completing the tutorial. Latest instance is shown below:

Jamie,
I moved ahead slightly, am getting following error when building your project.
Checked some other graphQL queries, which work perfectly fine otherwise, using POSTMAN or Shopify’s GraphQL tool.

If, possible, could you please advise
——

Error: GraphQL Error (Code: 404): {"response":{"error":"","status":404,"headers":{}},"request":{"query":"\n    {\n      > collectionByHandle(handle: \"firstcollection\") {\n        id\n        title\n        products(first: 12) {\n          edges {\n            node {\n              id\n              title\n              variants(first: 1) {\n                edges {\n                  node {\n                    id\n                  }\n                }\n              }\n              images(first: 1) {\n                edges {\n                  node {\n                    altText\n                    transformedSrc\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  "}}
   at /Users/asheeshmathur/git/Shopify-Sanity-Next-Example/node_modules/graphql-request/dist/index.js:254:31
   at step (/Users/asheeshmathur/git/Shopify-Sanity-Next-Example/node_modules/graphql-request/dist/index.js:63:23)
   at Object.next (/Users/asheeshmathur/git/Shopify-Sanity-Next-Example/node_modules/graphql-request/dist/index.js:44:53)
   at fulfilled (/Users/asheeshmathur/git/Shopify-Sanity-Next-Example/node_modules/graphql-request/dist/index.js:35:58)
   at processTicksAndRejections (node:internal/process/task_queues:96:5)
info  - Generating static pages (2/2)

Apparently this query works through an API client such as Postman, so it has to be related to the code. The emails started arriving not long after Shopify Unite so I'm not sure if there's been a breaking change in the latest version of the Storefront API that needs addressing.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions