Log on Server and local: Function utils has returned an error: Unexpected end of JSON input
I call from a client on host1 a function “utils” on host2.
In the old lambda world, the final return { headers: { 'access-control-allow-origin': '*' } } in the handler function worked.
Here the code I have written here seems to work for the dev-author, but maybe with more to do. Any help?
How are you even invoking Netlify Functions from :1313? That port is not handled by CLI and unless you somehow forward the requests to :8888 that would simply throw a 404.
This error likely also means that your Response() constructor failed due to (my guess) JSON.stringify() not working on a valid JSON. Since the Response didn’t get correctly constructed, it probably threw the error you mentioned.
Without a working reproduction, I can only continue guessing. Let me know if you can put something together for me to test this live.