Hey @dmenchaca Thanks for raising a question in the forums! Looking at your code, it seems you need to update your functions code to return the CORS headers. The docs detail this limitation here where the header rules don’t apply to dynamic calls such as serverless functions so you really only need them there.
I saw your comment about already trying this, however I think your codebase might be in a bad state causing confusion for you.
Looking at the codebase there are two function files attempting to do the same thing: netlify/functions/feedback.ts and netlify/functions/feedback/index.ts The latter file has cors headers set but the former does not. That said, I would not expect to see both of these files. Usually, developers would use one or the other approach for placing the function in your repo not both. My guess is that you’re attempting to fix the issue in the netlify/functions/feedback/index.ts but, based on Netlify’s precedence ordering, the netlify/functions/feedback.ts is the function that’s being invoked.
Looking at the two functions, they’re doing the same job. My suggestion would be to delete the netlify/functions/feedback.ts file and now your other function file should be the one that gets invoked and includes the CORS headers as expected.
Even in your screenshot, the URL returns a 404. You’re not deploying the Function at all. Your deploys appear to be manual deploys and I assume you might be dragging-n-dropping the output. That method works only for static pages and does not deploy Functions. You need to use Git-based deploys or CLI to deploy Functions.
I’m currently building this web app using Bolt.new and their “Deploy” to Netlify button.
I’m guessing there is no way then for me to deploy functions using Bolt.new’s “Deploy” button? Not even if I define that function and the deploy instructions in my code?
That’s a question for Bolt than Netlify, I’m afraid. They most likely use Netlify API to deploy and while it’s possible to use the API to deploy Functions, I don’t know if Bolt does it or not. When deploying via API, Netlify won’t run any build, it will deploy whatever you send as it is. So your deploy instructions do not make a difference.