2

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.

  • Please add some more context on the overall task you're trying to accomplish and steps before delving into the question. – optimist Apr 13 '20 at 06:16
  • @optimist thanks for the comment, i'm hoping to use gatsby with silverstripe hence the test site however my "gatsby develop" failed. I am trying to get my test site built. Edited my summary and hopefully that's more clearer now. :) – Priscilla Yap Apr 13 '20 at 20:38
  • This sometimes happens when SilverStripe isn't able to generate the GraphQL responses. Ideally it would render its error in JSON, but instead you get an HTML error page. Inspect your network request to see what it says. It's probably something easy for you to fix. – scrowler Apr 14 '20 at 17:31

0 Answers0