techjoomla / com_api

API framework for Joomla
http://docs.techjoomla.com/joomla-rest-api/com-api-introduction
GNU General Public License v3.0
123 stars 97 forks source link

FetchError: invalid json response body - GatsbyJS #123

Open milan-josipovic opened 4 years ago

milan-josipovic commented 4 years ago

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?