when I use the gatsby-source-shopify in gatsby-config, it come up with this error. but the site still ran
error an error occurred while sourcing data query: """ query GetPages($first: Int!, $after: String) { pages(first: $first, after: $after) { pageInfo { hasNextPage } edges { cursor node { id handle title body bodySummary updatedAt url } } } } """ variables: first: 250 after: null
the error is not obvious, but I forgot to put in my shopify store name in gatsby-config.js
{ resolve: "gatsby-source-shopify", options: { shopName: "selftaught-store", accessToken: "Store Front", verbose: true, paginationSize: 250, }, },
If you find my tips are useful, please support my work :)
After the fix with the last issue, I come across this error
Check your token has this read authorization, or omit fetching this object using the "includeCollections" options in gatsby-source-shopify plugin options
I have forgotten to tick these 2 boxes in my shopify storefront api private app
If you find my tips are useful, please support my work :)
small mistake I made with spelling,
- Your local gatsby-node.js is using the API "createPage" which is not a known API.
in gatsby-node.js
original code exports.createPage = async ({ graphql, actions: { createPage } }) => {}
I should spell createPages instead
working code exports.createPages = async ({ graphql, actions: { createPage } }) => {}
If you find my tips are useful, please support my work :)
When I try to add an item to cart, it come out with this error message
Cannot read property 'checkoutLineItemsAdd' of undefined
during the debug process, I found that I have connected to the Shopify Client but when I create my add to cart function
const addToCart = async variantId => { const newCheckout = client.checkout.create() ... ... }
I used async, but I forgot to put await in newCheckout
the correct code should be
const addToCart = async variantId => { const newCheckout = await client.checkout.create() ... ... }
If you find my tips are useful, please support my work :)
When I upgraded to latest OS Catalina and latest chrome, all my javascript file is not loading through https anymore. and it wouldnt allow me to allow the certificate.
go to chrome. chrome://flags/#allow-insecure-localhost Allow invalid certificates for resources loaded from localhost. -> pick enabled.
This will solve the problem.
If you find my tips are useful, please support my work :)
Quick Links