cancel
Showing results for 
Search instead for 
Did you mean: 

JSON Fehler beim Graphql

Highlighted

JSON Fehler beim Graphql

Wenn ich versuche mit yarn run build mein PWA zu builden kommt immer folgender Fehler:

{ FetchError: invalid json response body at https://mydomain.com/graphql reason: Unexpected token < in JSON at position 0
    at /pwa_path/packages/pwa-buildpack/node_modules/node-fetch/lib/index.js:241:32
    at process._tickCallback (internal/process/next_tick.js:68:7)
  message:
   'invalid json response body at https://mydomain.com/graphql reason: Unexpected token < in JSON at position 0',
  type: 'invalid-json' }

Kennt jemand diesen Fehler und kann mir da weiter helfen?

2 REPLIES 2
Highlighted

Re: JSON Fehler beim Graphql

Hi @justusguetd422 

 

This error comes due to issue in graphQl in any backend extension . First try to run the graphQl on chromeIQl and check `var/exception.log` and `var/system.log` . You will find you error .

If Issue Solved, Click Kudos/Accept As solutions

Highlighted

Re: JSON Fehler beim Graphql

Hi @justusguetd422,

Seems you are running a local backend for PWA, In the latest update GraphQL schema is updated to check for "ImageSwatchData" on configurable products. This will throw a 500 error and check for something like this in your var/exception.log.

 

report.CRITICAL: Report ID: graph-ql-5ebcc841110ff; Message: Config element "ImageSwatchData" is not declared in GraphQL schema {"exception":"[object] (Exception(code: 0): Report ID: graph-ql-5ebcc841110ff; Message: Config element \"ImageSwatchData\" is not declared in GraphQL schema at /home/ryan.jehan/www/m2-pwa-aligent/vendor/magento/framework/GraphQl/Exception/ExceptionFormatter.php:59, LogicException(code: 0): Config element \"ImageSwatchData\" is not declared in GraphQL schema at ../vendor/magento/framework/GraphQl/Config.php:57)"} []

 

You need to upgrade your instance to the latest M2 v2.3.5 and try.

 

Link: https://devdocs.magento.com/guides/v2.3/release-notes/release-notes-2-3-5-open-source.html

Link: https://devdocs.magento.com/guides/v2.3/graphql/product/configurable-product.html