My Gatsby site builds fine locally but keeps failing on Netlify. The error shows gatsby-source-airtable threw an error while running the sourceNodes lifecycle but doesn’t give me more details about what went 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: `Statistics`,
mapping: { Description: `text/markdown` },
},
{
baseId: myBaseId,
tableName: `Categories`,
tableLinks: [`Category`],
},
],
},
}
I’m using these versions:
"gatsby-source-airtable": "^2.1.1",
"react": "^16.12.0",
"gatsby-source-graphql": "^2.7.6"
I tried deleting node_modules and package-lock.json then reinstalling everything but still get the same error on Netlify while it works perfectly on my machine. Has anyone seen this before? What could be causing this difference between local and production builds?
check your netlify build logs for specific error messages - they’re usually buried deeper in the console. also try setting concurrency to 1 in your config. airtable’s api gets overwhelmed during builds sometimes and throws these vague errors.
It seems like you might be encountering an issue with environment variables. I’ve faced a similar problem previously where Netlify wasn’t recognizing my AIRTABLE_API_KEY despite it being configured in the settings. This resulted in the plugin returning undefined values during the build process. I recommend placing a console.log in your gatsby-config.js file to verify if the API key is being retrieved correctly. Additionally, double-check the permissions associated with your Airtable base; sometimes the API key may lose access to specific tables. If it’s functioning well locally but failing on Netlify, the root cause is likely related to environment configurations rather than the code itself.
This error screams rate limiting or timeout issues - Netlify can’t fetch your data from Airtable’s API fast enough. I’ve been there. My builds worked fine locally but kept dying on Netlify’s servers. Netlify’s build environment has stricter timeouts and different network conditions than your local setup. Add timeout configs to your plugin options and temporarily cut down your linked tables to narrow down the problem. Also check if your Airtable base got way bigger since your last successful build - huge datasets can push you past Netlify’s build time limits. You’ll probably need to add pagination or filtering to make builds more reliable.