# First deploy after adding edge-function

**URL:** <https://answers.netlify.com/t/first-deploy-after-adding-edge-function/84616>\
**Category:** Support\
**Tags:** edge\_functions, deployment\
**Created:** [February 3, 2023, 1:57am UTC](https://answers.netlify.com/t/first-deploy-after-adding-edge-function/84616 "2023-02-03T01:57:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amalitsky](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/amalitsky/32/45245_2.png) [@amalitsky](https://answers.netlify.com/u/amalitsky)\
**Post date:** [February 3, 2023, 1:57am UTC](https://answers.netlify.com/t/first-deploy-after-adding-edge-function/84616/1 "2023-02-03T01:57:32Z")

</div>

Hi, everyone! Love the product and never ending flow of new features!

There **might be** a problem with deploying edge function for the first time - I couldn’t get mine to work with manual deploys **until** I passed `--build` flag to the deploy command. Normally I do my builds before running `deploy`.

I use the word _might_ because I can’t reproduce it anymore! Now I deploy without the `--build` flag and edge-function gets indexed as expected. I haven’t updated it yet (or added another one) to check if new version will get deployed.

I **don’t** use the `[[edge_functions]]` config field since I’m registering it in the file itself and am using the default location.

My assumption is that some build process has to be involved for edge functions indexing/deployment and here is the line of [Netlify CLI package code](https://github.com/netlify/cli/blob/main/src/commands/deploy/deploy.mjs#L582) which caught my attention.

It seems like the edge function bundling step might be skipped unless `[[edge_functions]]` block is present in toml file or `--build` flag is passed to `deploy` command. Which doesn’t cover my case with separate builds and edge functions registered in-file. _This is pure speculation on my side._

I’ll update this topic if I have more data. Feel free to close it after review.

Cheers  
Alex

**Context:**

- Netlify CLI version: 12.10.0
- `netlify dev` works as expected
- [https://local-build--amlab.netlify.app/](https://local-build--amlab.netlify.app/)
- currently getting _500 uncaught exception during edge function invocation_ from my edge function 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![amalitsky](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/amalitsky/32/45245_2.png) [@amalitsky](https://answers.netlify.com/u/amalitsky)\
**Post date:** [February 5, 2023, 6:20am UTC](https://answers.netlify.com/t/first-deploy-after-adding-edge-function/84616/2 "2023-02-05T06:20:19Z")

</div>

I’m guessing 500 error is due to the timeout - I don’t get any edge function logs in UI, hence hard to debug.

I the meantime I will switch over to usual server functions, since my use case is to send an email and 50ms execution limit is not what I need to make it work.

---

<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:** [February 5, 2023, 7:51am UTC](https://answers.netlify.com/t/first-deploy-after-adding-edge-function/84616/3 "2023-02-05T07:51:14Z")

</div>

@amalitsky Sounds like the right move, Edge Functions are for fast responses and if you’re reaching out to another API to perform a send it’s unlikely it would/could execute fast enough.
