Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Plugin @fika/gatsby-source-cockpit returned an error #30

Closed
Hypothesis-github opened this issue Feb 14, 2019 · 2 comments
Closed

Comments

@Hypothesis-github
Copy link

Hypothesis-github commented Feb 14, 2019

I have 2 types of error first is generated with

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

and is

 error Plugin @fika/gatsby-source-cockpit returned an error


  Error: Token config parameter is invalid

  - CockpitService.js:45 CockpitService.validateToken
    [gatsby-cockpit]/[@fika]/gatsby-source-cockpit/src/CockpitService.js:45:13

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

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

and it turns into

error Plugin @fika/gatsby-source-cockpit returned an error


  TypeError: names.filter is not a function

  - CockpitService.js:91 CockpitService.getCollections
    [gatsby-cockpit]/[@fika]/gatsby-source-cockpit/src/CockpitService.js:91:10


please guide me.

@WhippetsAintDogs
Copy link
Collaborator

WhippetsAintDogs commented Feb 14, 2019

Hi @Hypothesis-github!

The baseUrl you should set in your plugin configuration is: http://hfp.co.ir/cockpit, with no / at the end. Did you tried that ? If so, what was the output ?

If it tells you that error: Error: Token config parameter is invalid, it's because you have not properly set your Master API Key in the token configuration parameter. The Master API Key can be generated and found in Cockpit under the Settings > API Access page. :)

@DigitalGoldfish
Copy link
Collaborator

TypeError: names.filter is not a function

We should add a check if names is an array and not empty here and either ignore it (no collections might happen once we support singletons) or throw a more appropriate error if we can detect that there is no Cockpit Instance available at that URL..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants