Build fails with gatsby-source-airtable error during sourceNodes phase

My Gatsby site builds fine locally but keeps failing when deployed to Netlify. The error message points to gatsby-source-airtable having issues during the sourceNodes lifecycle but doesn’t give much detail about what’s actually wrong.

{
  resolve: `gatsby-source-airtable`,
  options: {
    apiKey: process.env.AIRTABLE_API_KEY,
    concurrency: 3,
    tables: [
      {
        baseId: myBaseId,
        tableName: `Products`,
        queryName: true,
        tableLinks: [
          `Categories`,
          `Product_Images`
        ],
      },
      {
        baseId: myBaseId,
        tableName: `Stats`,
        mapping: { Description: `text/markdown` },
      },
      {
        baseId: myBaseId,
        tableName: `Categories`,
        tableLinks: [`Category`],
      },
    ],
  },
}

Package versions I’m using:

"gatsby-source-airtable": "^2.1.1",
"react": "^16.12.0",
"gatsby-source-graphql": "^2.7.6"

I tried clearing node_modules and package-lock.json then reinstalling everything but same issue. Works perfectly in development but deployment always fails at the same spot. Anyone know what might be causing this?

Check if your Airtable base is in a different region. I had this exact issue - my base was in Europe but Gatsby was hitting US servers during Netlify builds. Try adding endpointUrl: 'https://api.airtable.com' to force the right region. Also, your Gatsby version might be too old for that plugin version.

Had the same issue last month with gatsby-source-airtable. Worked fine locally but kept breaking on deployment.

It’s a timeout problem - Netlify’s build environment has stricter time limits than your local setup. When your Airtable base grows, the sourceNodes phase can hit these limits and crash without telling you why.

Add a timeout config to your plugin options:

options: {
  apiKey: process.env.AIRTABLE_API_KEY,
  concurrency: 3,
  timeout: 30000,
  // rest of your config
}

Also check your Airtable base permissions. Sometimes the API key works in dev but has different access in production. Make sure it can read all the tables you’re querying.

Watch out for circular references in linked tables too. The tableLinks config can create infinite loops during sourceNodes if Categories links back to Products unexpectedly.

This sounds like a schema inference issue during Gatsby’s production build. The sourceNodes phase crashes when your Airtable base has empty tables or inconsistent field types that work locally but fail during static generation.

First, check if your linked tables (Categories, Product_Images) are completely empty in Airtable. Gatsby needs at least one record to infer the GraphQL schema properly. I hit this exact problem when my client deleted all records from a linked table during testing.

Second issue could be field type mismatches. If you’ve got a field that’s sometimes text, sometimes numbers, it’ll crash sourceNodes. Make sure your Airtable field types stay consistent across all records.

Try adding error handling to your gatsby-config.js - wrap the plugin configuration in a try-catch block. Also double-check that your tableLinks array references actual table names from your base. Case sensitivity matters here.

I’ve hit this exact issue with Airtable and Netlify before. Usually it’s your environment variables not being set right in Netlify’s build environment.

First, check if your AIRTABLE_API_KEY is actually in your Netlify site settings. Go to Site settings > Environment variables and confirm it’s there.

I see you’re using myBaseId directly in your config. If that’s just a placeholder and you’re using a hardcoded string, you’re good. But if it should be an environment variable, wrap it in process.env.AIRTABLE_BASE_ID or whatever you called it.

Here’s something that bit me once - Airtable’s rate limiting gets stricter in production builds. Try dropping your concurrency from 3 to 1 temporarily:

concurrency: 1,

The Netlify team has a solid walkthrough for debugging deployment failures:

If you’re still stuck, enable debug logging by adding DEBUG=gatsby-source-airtable to your build environment variables in Netlify. You’ll get way more detailed error messages to work with.