I'm facing an unexpected error that has left me puzzled.
Let me walk you through what I am trying to accomplish:
The task at hand involves fetching data from one API and then transmitting it to another. This process is executed as a background-function job within Netlify, integrated into a NextJS website.
Initially, I suspected that the issue stemmed from mishandling the response. Hence, I made adjustments such as including
return res.status(200).json({ success: true, result: result });
in the code snippet provided. However, this did not resolve the problem.
Subsequently, I pondered whether the presence of req
in my function was causing the trouble, but I find myself uncertain about how to address it effectively.
Importantly, I must highlight that when running locally using netlify-cli
, everything operates seamlessly without any glitches. It's only upon deployment to production that the error surfaces.
Below is the excerpt of code in question:
// Insert your code here
Your suggestions and guidance would be immensely valued. Thank you for your assistance.