Nextjs-Shopify Template checkoutCreate Error

I’m trying to use the nextjs-shopify template on your GitHub. I follow all the steps and when I run npm run dev the site shows a “Unhandled Runtime Error: Error: The checkoutCreate mutation failed due to an unknown error.” And then shows a 404 not found page. I’m not sure what I’m doing wrong here.

Ok, I did figure out the 404 issue. I didn’t have a page created for / so now the page is loading. But I’m still getting the checkoutCreate mutation failed error.

Hey @kslo,

I’m glad you were able to resolve the 404. Are you on windows or mac? Are you just using the default Next-js Shopify starter or have you added additional code? I’m not able to recreate this error on my end but I’ve seen this error occur before when the wrong token/keys are added to the env file. Can you double check that you have the correct details added there? If these are already correct, I’d be happy to help dig in further.

hey @maddy,

Thanks for the response. It must have been the Shopify API key. I decided to scrap the API key that I was using and created a brand new private app with a new storefront api key. I don’t get the graphql error anymore. Thanks for your help!

1 Like