Skip to content

FetchError: invalid json response body - GatsbyJS #123

Description

@milan-josipovic

Hi,

My goal is to connect the GatsbyJS hello-world site with Joomla welcome site to fetch the data from Joomla and display them in GatsbyJS site.

  1. I installed GatsbyJS Plugin gatsby-source-joomla-articles (https://www.gatsbyjs.com/plugins/@nilesh_s_techjoomla/gatsby-source-joomla-articles/?=joomla).
  2. I started simple hello-world Joomla welcome site (https://joomla-rest-api.joomla.com/).
  3. I added com_api (https://github.com/techjoomla/com_api) to Joomla in order to fetch the data from Joomla site.

Now when I start a local build of GatsbyJS site I get an errror:

FetchError: invalid json response body at https://joomla-rest-api.joomla.com/index.php&limitstart=0&limit=20 reason: Unexpected token < in JSON at position 0
at C:\Users\PC\Desktop\my-hello-world-starter\node_modules@nilesh_s_techjoomla\gatsby-source-joomla-articles\node_modules\node-fetch\lib\index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Object.exports.sourceNodes (C:\Users\PC\Desktop\my-hello-world-starter\node_modules@nilesh_s_techjoomla\gatsby-source-joomla-articles\gatsby-node.js:58:23)
at runAPI (C:\Users\PC\Desktop\my-hello-world-starter\node_modules\gatsby\src\utils\api-runner-node.js:330:16) {
type: 'invalid-json'
}

Could you, please be kind to help me out with problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions