# 502 Error After Deploying Edge Functions to Block Bots in Next.js on Netlify

**URL:** <https://answers.netlify.com/t/502-error-after-deploying-edge-functions-to-block-bots-in-next-js-on-netlify/147637>\
**Category:** Support\
**Tags:** edge\_functions, netlify-newbie\
**Created:** [May 12, 2025, 12:49pm UTC](https://answers.netlify.com/t/502-error-after-deploying-edge-functions-to-block-bots-in-next-js-on-netlify/147637 "2025-05-12T12:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpdeployapp](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dpdeployapp](https://answers.netlify.com/u/dpdeployapp)\
**Post date:** [May 12, 2025, 12:49pm UTC](https://answers.netlify.com/t/502-error-after-deploying-edge-functions-to-block-bots-in-next-js-on-netlify/147637/1 "2025-05-12T12:49:26Z")

</div>

We are having an issue configuring edge functions in our Next.js project to block bots that are consuming many of our functions. This is our `netlify.toml` file — the build completes successfully, but we get a 502 error. I don’t understand why.

Our site ID is: **87b14273-bcd5-4b0e-9f40-922487949deb**.

---

<div class="post-metadata">

**Author:** ![nathanmartin](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nathanmartin/32/30845_2.png) [@nathanmartin](https://answers.netlify.com/u/nathanmartin)\
**Post date:** [May 12, 2025, 1:08pm UTC](https://answers.netlify.com/t/502-error-after-deploying-edge-functions-to-block-bots-in-next-js-on-netlify/147637/2 "2025-05-12T13:08:41Z")

</div>

@dpdeployapp Check your Function logs:  
[https://docs.netlify.com/functions/logs/](https://docs.netlify.com/functions/logs/)

They should provide more detail regarding the error.
