First deploy after adding edge-function

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 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/
  • currently getting 500 uncaught exception during edge function invocation from my edge function :man_shrugging:

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.

@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.