Help

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

Solved
Jump to Solution
459 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Akshat_Sharma
4 - Data Explorer
4 - Data Explorer

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
Akshat_Sharma
4 - Data Explorer
4 - Data Explorer
1 Reply 1
Akshat_Sharma
4 - Data Explorer
4 - Data Explorer

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

Closing the issue