mpartipilo / gatsby-source-cockpit

Gatsby plugin to access remote content from a Cockpit API (http://getcockpit.com/)
MIT License
13 stars 3 forks source link

Plugin gatsby-source-cockpit returned an error #9

Open Hypothesis-github opened 5 years ago

Hypothesis-github commented 5 years ago

I have 2 types of error first is generated with

host: "http://domain.com/cockpit",

and is

info Fetching list of assets
error Plugin gatsby-source-cockpit returned an error

  TypeError: Cannot read property 'length' of undefined

  - gatsby-node.js:43 Object.exports.sourceNodes
    [gatsby-cockpit]/[gatsby-source-cockpit]/gatsby-node.js:43:53

second one I change the URL and I add a / at the end

host: "http://domain.com/cockpit/",

and it turns into

FetchError: invalid json response body at http://hfp.co.ir/cockpit/auth/login reason: Unexpected token < in JSON at position 0

please guide me.

mpartipilo commented 5 years ago

The unexpected token < usually means a 404 with some html was returned by the server.

The one with the list of assets, if I recall correctly, means that you have no assets in your cockpit server.

I know, it’s sloppy. I’ll try to publish my latest version this weekend.

Also, I’m not sure I’ve updated this to work with gatsby v2... be warned.

Michelangelo P.

On 14 Feb 2019, at 18:47, Hypothesis notifications@github.com wrote:

I have 2 types of error first is generated with

host: "http://domain.com/cockpit",

and is

info Fetching list of assets error Plugin gatsby-source-cockpit returned an error

TypeError: Cannot read property 'length' of undefined

  • gatsby-node.js:43 Object.exports.sourceNodes [gatsby-cockpit]/[gatsby-source-cockpit]/gatsby-node.js:43:53 second one I change the URL and I add a / at the end

host: "http://domain.com/cockpit/",

and it turns into

FetchError: invalid json response body at http://hfp.co.ir/cockpit/auth/login reason: Unexpected token < in JSON at position 0

please guide me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.