w3bdesign/nuxtjs-woocommerce

Weird Error

Closed this issue · 6 comments

rofkk commented

I followed every step as you mentioned, and after running the dev mode I got the error:
GraphQL error: Cannot query field "id" on type "CartItemToProductConnectionEdge". 01:00:47
GraphQL error: Cannot query field "databaseId" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "slug" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "averageRating" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "reviewCount" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "galleryImages" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "id" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "databaseId" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductVariationConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "price" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "regularPrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "salePrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "nodes" on type "VariationAttribute". Did you mean "name"?

GraphQL error: Cannot query field "databaseId" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "slug" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "averageRating" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "reviewCount" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "galleryImages" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "id" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "databaseId" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductVariationConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "price" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "regularPrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "salePrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "nodes" on type "VariationAttribute". Did you mean "name"?
at new ApolloError (node_modules\apollo-client\bundle.umd.js:92:26)
at node_modules\apollo-client\bundle.umd.js:1588:34
at node_modules\apollo-client\bundle.umd.js:2008:15
at Set.forEach ()
at node_modules\apollo-client\bundle.umd.js:2006:26
at Map.forEach ()
at QueryManager.broadcastQueries (node_modules\apollo-client\bundle.umd.js:2004:20)
at node_modules\apollo-client\bundle.umd.js:2131:19
at Object.next (node_modules\zen-observable\lib\Observable.js:322:23)
at notifySubscription (node_modules\zen-observable\lib\Observable.js:135:18)
at onNotify (node_modules\zen-observable\lib\Observable.js:179:3)
at SubscriptionObserver.next (node_modules\zen-observable\lib\Observable.js:235:7)
at node_modules\apollo-client\bundle.umd.js:1102:36
at Set.forEach ()
at Object.next (node_modules\apollo-client\bundle.umd.js:1101:21)
at notifySubscription (node_modules\zen-observable\lib\Observable.js:135:18)

Error GraphQL error: Cannot query field "id" on type "CartItemToProductConnectionEdge". 01:00:48
GraphQL error: Cannot query field "databaseId" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "slug" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "averageRating" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "reviewCount" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "galleryImages" on type "CartItemToProductConnectionEdge".
GraphQL error: Cannot query field "id" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "databaseId" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "name" on type "CartItemToProductVariationConnectionEdge". Did you mean "node"?
GraphQL error: Cannot query field "description" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "type" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "onSale" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "price" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "regularPrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "salePrice" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "image" on type "CartItemToProductVariationConnectionEdge".
GraphQL error: Cannot query field "nodes" on type "VariationAttribute". Did you mean "name"?
C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\zen-observable\lib\Observable.js:65
throw e;
^

TypeError: Cannot read property 'cart' of undefined
at VueComponent.result (server.js:3825:32)
at SmartQuery.nextResult (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\vue-apollo\dist\vue-apollo.umd.js:917:31)
at SmartQuery.catchError (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\vue-apollo\dist\vue-apollo.umd.js:932:14)
at notifySubscription (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\zen-observable\lib\Observable.js:140:18)
at onNotify (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\zen-observable\lib\Observable.js:179:3)
at SubscriptionObserver.error (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\zen-observable\lib\Observable.js:240:7)
at C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\apollo-client\bundle.umd.js:565:25
at Array.forEach ()
at iterateObserversSafely (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\apollo-client\bundle.umd.js:564:25)
at Object.onError [as error] (C:\Users\LAB\Documents\nuxtjs-woocommerce\node_modules\apollo-client\bundle.umd.js:504:9)

@rofkk Most likely you either didn't setup the environment variables correctly or you didn't install and setup the required plugins correctly.

It would help a lot if you provided me with more information about your setup (plugin versions etc) as well as the steps you have followed.

@rofkk

Any update on this?

I regularly close inactive issues after some time, so please keep me updated.

rofkk commented

I got now this error: Network error: request to https://mysite.com/graphql failed, reason: getaddrinfo ENOTFOUND mysite.com

I got now this error: Network error: request to https://mysite.com/graphql failed, reason: getaddrinfo ENOTFOUND mysite.com

@rofkk

You need to rename .env.example to .env and modify the values there.

I also need more information on your setup and which steps you have followed.

Confirmed solved.

Also added a troubleshooting section in README

For anyone else reading this, the issue was solved by downgrading Woo WP Graphql to version 0.61.