Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Airtable API Nodefetch Error, Sometime works & most of the time fails

Topic Labels: API
Solved
Jump to Solution
594 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello team, airtable api are failing & throwing random errors, works on local but fails on production…

API Code -

    const Airtable = require('airtable');
const base = new Airtable({
  apiKey: 'API_KEY',
  requestTimeout: 1000
}).base('BASE_ID');

function updateAirtableSheetValues(data){

 base('Table 1').create([
    {
      "fields": {
        "Name": data
      }
    }
  ], function(err, records) {
    if (err) {
      console.error(err);
      return;
    }
    records.forEach(function (record) {
      console.log(record.getId());
    });
  });

}

export default async (req, res) => {
  if (req.method === "POST") {
    const { body } = req;

    updateAirtableSheetValues(body.data);

    res.statusCode = 200;
  }

  res.json({ msg: "Thank you" });
};

Error -
image

1 Solution

Accepted Solutions
1 Reply 1

The fix is here - https://github.com/vercel/next.js/issues/17104

Closing the issue