Server functions on localhost `ntl functions:serve --port=9999`

Hi. I am using a command to serve functions on localhost, and another command to serve the app. The full npm start command:

"concurrently --kill-others \"vite\" \"npx ntl functions:serve --port=9999\"",

see the source code

in the function, we return a string as the body. But in the app we just see an empty string as the body response

return {
            statusCode: 200,
            body: 'aaaaaa'
        }

But, in the OS terminal, it does log like I would expect.

It’s just the response that is wrong.

Thanks for reading this. I wonder if it is a bug in netlify CLI, or if I have configured things wrong.

I should mention also, the command ntl dev does serve the app, but it does not have things like live refresh, or any refresh, so that’s why I am using one command for vite and another for the functions.

If I start it with ntl dev, though, then the functions do work like I expect them too, and I get a proper response in the browser console.

It turns out this was an issue with the browser + fetch requests, because it did work using postman to test.

Hi @nichoth :wave:t6: ,

Thanks so much for confirming! Glad you were able to resolve your issue.