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

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 -

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

Closing the issue

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.