If you are using Next.js 14 and under you will get:
"WEBPACK_IMPORTED_MODULE_3_.functionName) is not a function".
On Next.js 15, it says
"[ Server ] Error: Attempted to call functionName() from the server but functionName is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
In conclusion, you need to create a client component and call the function there, then return the client component.
Sorry if this seems out of place or poorly worded. I am very frustrated it took this long for me to fix and needed to get this out.