diegolamanno / gatsby-source-greenhouse

Gatsby source plugin for loading job openings from greenhouse.io ⚛️
MIT License
11 stars 16 forks source link

Getting a `Failed to fetch data from Greenhouse` error #9

Open jamesncampbell opened 5 years ago

jamesncampbell commented 5 years ago

I'm using this package to pull in some job posts data but I'm getting the following error during the gatsby build...

Fetch Greenhouse data
Starting to fetch data from Greenhouse
Failed to fetch data from Greenhouse

The apiToken I have is only configured to access all endpoints related to jobs, i.e. jobs, job posts, job openings, etc. I can cURL -u with the apiToken and get the correct data so I'm sure that's working correctly. Any insight into what could be going wrong?

My gatsby-plugin.js file looks as follows:

require('dotenv').config({
  path: `.env.${process.env.NODE_ENV}`,
})

const path = require('path')

console.warn('process env', process.env.GREENHOUSE_API_KEY) // outputs the correct apiToken

module.exports = {
  plugins: [
    `gatsby-plugin-sass`,
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-offline',
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: 'images',
        path: `${__dirname}/images`,
      },
    },
    'gatsby-plugin-sharp',
    'gatsby-transformer-sharp',
    {
      resolve: `gatsby-source-greenhouse`,
      options: {
        apiToken: process.env.GREENHOUSE_API_KEY,
        jobPosts: {
          live: true,
        },
      },
    },
  ],
}
diegolamanno commented 5 years ago

Hey @jamesncampbell just dropping here to let you know I already saw your issue. Going to take a look at this weekend. Thanks for your contribution!

mikeyp commented 5 years ago

I'm seeing the same issue. Based on what I can see from the API, this is missing a place to put the Job board API, unless this is using a different API.

https://developers.greenhouse.io/job-board.html#list-jobs