Open catboxer opened 3 years ago
I cannot replicate the issue, I deployed and tested here and it works fine. https://gatsby-woocommerce-theme.netlify.app/
Can you console.log( error ) and see what you are getting?
when i console.log(error) I get console.log( error )
VM198:1 Uncaught ReferenceError: error is not defined
at
I should have also mentioned that when I clicked add to cart this mutation error came up. I am using the app Local for my local wp development on my site. .env file WORDPRESS_SITE_URL=http://mikestore.local GATSBY_SITE_URL=http://localhost:8000
and when I go to http://localhost:8000/__graphQL it all works.
It is when I click on add to cart that this happens in console:
Uncaught (in promise) TypeError: Cannot read property 'message' of undefined at onError (index.js:63) at MutationData.../node_modules/@apollo/client/react/data/MutationData.js.MutationData.onMutationError (MutationData.js:90) at MutationData.js:22
onError @ index.js:63 ../node_modules/@apollo/client/react/data/MutationData.js.MutationData.onMutationError @ MutationData.js:90 (anonymous) @ MutationData.js:22 Promise.catch (async) MutationData._this.runMutation @ MutationData.js:21 handleAddToCartClick @ index.js:70 callCallback @ react-dom.development.js:3946 invokeGuardedCallbackDev @ react-dom.development.js:3995 invokeGuardedCallback @ react-dom.development.js:4057 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4071 executeDispatch @ react-dom.development.js:8244 processDispatchQueueItemsInOrder @ react-dom.development.js:8276 processDispatchQueue @ react-dom.development.js:8289 dispatchEventsForPlugins @ react-dom.development.js:8300 (anonymous) @ react-dom.development.js:8509 batchedEventUpdates$1 @ react-dom.development.js:22397 batchedEventUpdates @ react-dom.development.js:3746 dispatchEventForPluginEventSystem @ react-dom.development.js:8508 attemptToDispatchEvent @ react-dom.development.js:6006 dispatchEvent @ react-dom.development.js:5925 unstable_runWithPriority @ scheduler.development.js:646 runWithPriority$1 @ react-dom.development.js:11277 discreteUpdates$1 @ react-dom.development.js:22414 discreteUpdates @ react-dom.development.js:3757 dispatchDiscreteEvent
I am also experiencing this issue. I have a hunch it's relating to a persisting CORS policy issue. Has there been any movement on this? I haven't been able to come to a resolution. @imranhsayed @catboxer
I was also experiencing this issue. I resolved the error by changing the GATSBY_WORDPRESS_URL env variable to my WordPress backend url
That worked for me. Thanks
getting this error. Please help. have tried everything i can think of
onError src/components/cart/add-to-cart-button/index.js:63.
Installed latest plugins. Any suggestions on what might be the issue would be greatly appreciated.