Skip to main content

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(e

{

"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


Reply