Functions cannot being called by website but works on API client

Hello :slight_smile:

I’m new on netlify and I believe I’m having some issue with my functions caused by the building or some missing config on my netlify.toml

I have the website: https://susantos.netlify.app/ which calls this function on this page

The function is working fine on my localhost and also when I called it by using insomnia. But when I call it from my website it returns nothing. Not even an error, it seems it has never been called at all.

The website was imported on netlify using github and the function was added later using the command netlify functions:create

I believe there is something wrong with the build because when I publish the website autimatically by commiting changes on github the functions disappear and the endpoint returns 404 at insomia. But if I use netlify deploy --prod all the console.log that I added on my page page stops working and the function works at insomnia.

Someone can please help me figure out what is happening?
Thanks in advance

Hi,

Thanks for reaching out! Have you created a netlify/functions path at the root of the project for automatic detection. Alternatively, you could use another path (e.g. functions ), adding the directory configuration similarly to this user in this post.

Yes I created at ~netlify/functions

It works using insomnia. Just when I call through the page it seems is not being called at all (although its working locally)

I changed the title because I was making a silly mistake. Was ignoring netlify/functions folder on github thats way it was overriding when publishing by github.

I still don’t know why doesn’t work when I call the function through the webpage :frowning:

Hey I clicked manually on “clear cache and deploy” and now it works.

Thank you for your kindness and willingness to help I was 2 days struggling with this already.

Oh that’s awesome! I’m glad you got a solution. (: happy building! :rocket: