首页 > 解决方案 > Gatsby develop failed: Fetching SilverStripe data failed Cannot read property 'data' of undefined after setting up silverstripe-gatsby

问题描述

I am new to gatsby and was trying to test out Gatsby with Silverstripe. If it goes well, it may be great solution to one of our work project.

I have a test silverstripe site working along which I install from the instruction available here: https://github.com/unclecheese/gatsby-starter-silverstripe

With the instructions, My SS4.5 site is working fine as well as the endpoint /__gatsby/graphql as I am able to add query to the endpoint.

As I tried to run "gatsby develop" as per instruction, the following errors appear and my site was not built..:

my host url is also configured in the config.js.

FetchError: invalid json response body at http://localhost/gatsbyv3/__gatsby/graphql reason: Unexpected token < in JSON at position 0

ERROR

Fetching SilverStripe data failed Cannot read property 'data' of undefined TypeError: Cannot read property 'data' of undefined

I'm not sure if I've missed anything and have not edited the config file. Any help or advice would be much appreciated. Thank you in advance.

标签: graphqlsilverstripe-4

解决方案


推荐阅读