Netlify function not updating

Hi,

I have updated my Netlify function but it doesn’t appear to have updated. The code is still pointing to the old version and it’s been almost 24 hours. This is clear from looking at the logs. Do I need to wait longer? Is this normal every time I update the function? I have redeployed from the same commit twice using the UI but to no avail. It seemed to work very briefly as I received one email (the change I have made triggers an email) but it appeared to revert back after just one use.

My netlify site name is: https://unruffled-brattain-cc7a63.netlify.app

Appears related to https://answers.netlify.com/t/how-long-does-it-take-for-netlify-functions-to-be-updated-globally-functions-cdn

Thanks

1 Like

Hey @amin-nejad ,
If the function changes are different enough to change the function file checksum, then we will upload the new version. So, one space added to the end of a line likely won’t update, but if you’re writing new console.log lines, that will update.

What do you see in the function logs when you POST to it now vs. what would you expect to see? We can’t see old function logs, and when I trigger the function from the UI, I get an error since I’m not sending the correct payload (though I do see success:false in the browser!). Thanks in advance for the additional info!

1 Like

HI @jen, thanks for getting back to me! I definitely have new log messages and new functionality that sends an email on correct form submission so the checksum should have definitely been triggered. It all works locally (using netlify dev) but when pushing, the old unmodified function is still being used somehow as there are no emails and none of the new logs (denoting whether email send was successful or not).

I found another example where something like this appears to have happened:

and a fix was put in place. I don’t know if the two are related at all - I am also redirecting my function. I’ll try and push a new commit with just a trivial log message to re-trigger deployment and see if it the changes get reflected.

hi @amin-nejad , did a new commit with a new log message help?

Hi @perry, sorry for the late reply. I think the problem is actually the part of the code where I use nodemailer. New console log messages in the code are indeed reflected in the logs. I’m not sure why nodemailer works locally but not in production. Do you have any idea what might be causing this? Thanks, Ali

Hey there, @amin-nejad :wave:

Looks like this thread has been a bit quiet the past few days. Have you made any progress on this since you last posted, or are you still experiencing this issue? Let us know :slight_smile: