jbolda / gatsby-source-airtable

MIT License
216 stars 43 forks source link

The gatsby-source-airtable plugin has generated no Gatsby nodes. #207

Closed amandakievet closed 4 years ago

amandakievet commented 4 years ago

👋 I wanted to test out AirTable as a data source so I set up a completely new Gatsby repo gatsby new my-repo-name

Then I added this plugin npm install --save gatsby-source-airtable

Then I plugged in my Airtable API Key, the base ID and a table name and when I ran gatsby develop, I got the error:

 ERROR #11321  PLUGIN

"gatsby-source-airtable" threw an error while running the sourceNodes lifecycle:

warn The gatsby-source-airtable plugin has generated no Gatsby nodes. Do you need it?

I do have records set up in my AirTable, though I am on a Pro Plan Trial. I'm not sure if that would matter?

Here's my package.json:

{
  "name": "gatsby-starter-default",
  "private": true,
  "description": "A simple starter to get up and developing quickly with Gatsby",
  "version": "0.1.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "dotenv": "^8.2.0",
    "gatsby": "^2.21.37",
    "gatsby-image": "^2.4.4",
    "gatsby-plugin-manifest": "^2.4.5",
    "gatsby-plugin-offline": "^3.2.3",
    "gatsby-plugin-postcss": "^2.3.2",
    "gatsby-plugin-react-helmet": "^3.3.1",
    "gatsby-plugin-sharp": "^2.6.4",
    "gatsby-source-airtable": "^2.1.1",
    "gatsby-source-filesystem": "^2.3.4",
    "gatsby-transformer-sharp": "^2.5.2",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-helmet": "^6.0.0"
  },
  "devDependencies": {
    "prettier": "2.0.5",
    "tailwindcss": "^1.4.6"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

And here's my gatsby.config:

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

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
    description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
    author: `@gatsbyjs`,
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-postcss`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#663399`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
      },
    },
    {
      resolve: `gatsby-source-airtable`,
      options: {
        apiKey: `xxxxxxxxxxxxxxxx`,
        concurrency: 5,
        tables: [
          {
            baseId: `xxxxxxxxxxxxxxxxx`,
            tableName: "Artists",
            separateNodeType: false,
            separateMapType: false,
          },
        ],
      },
    },
  ],
}

(xxxxx... are my actual keys in my file)

Thanks

amandakievet commented 4 years ago

Issue was I grabbed the wrong base id — i thought it was in the URL of my base, but when I checked the API documentation (handy feature) for that table, it showed a different one. Thanks anyway!

roNn23 commented 3 years ago

Got the same problem, but for me it was the tableName. Thought the name of the base is the name of the table. Adding an image, maybe it will help someone in the future!

Screenshot 2021-05-29 at 17 18 44