Netlify functions in react-storybook

I’m trying to invoke a netlify function from react-storybook which is running on local dev through port 6006. But I’m getting a not found error (the server responded with a status of 404).
I’ve tried setting targetPort to 6006 and port to 6006. But those didn’t work. How do I resolve this error?

How are you invoking the Function? Are you using CLI? The Functions almost always run on localhot:8888.

The functions run on localhost:8888. But I want it to run in my storybook where the component is being used. storybook runs on localhost:6006

Netlify CLI will always run on 8888 and you should ignore your Storybook server as the CLI will do its job. So, just visit your site at localhost:8888.