You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Next.js 15 with Node.js v18.20.3, I encounter an error:
[ Server ] Error: Cannot read properties of undefined (reading 'call')
This happens when I try to export functions from other files that have 'use server' at the top.
Changing the exported function from an arrow function to a normal function expression resolves the error temporarily.
However, restarting the server (via npm run dev) causes the same error to reappear, and I need to reverse the function type (e.g., from normal function expression to arrow function) for it to work again.
This creates a loop where I constantly have to toggle the function type after every server restart to avoid the error. It seems like a bug related to the use of 'use server' or the server's handling of function exports.
Describe the bug
When using Next.js 15 with Node.js v18.20.3, I encounter an error:
[ Server ] Error: Cannot read properties of undefined (reading 'call')
This happens when I try to export functions from other files that have
'use server'
at the top.npm run dev
) causes the same error to reappear, and I need to reverse the function type (e.g., from normal function expression to arrow function) for it to work again.This creates a loop where I constantly have to toggle the function type after every server restart to avoid the error. It seems like a bug related to the use of
'use server'
or the server's handling of function exports.Link to the blitz that caused the error
https://stackblitz.com/~/github.com/clickspider/bolt-nextjs-subscription-payments/tree/debug-main-13
Steps to reproduce
'use server'
at the top.npm run dev
and observe the error:[ Server ] Error: Cannot read properties of undefined (reading 'call')
Expected behavior
The exported function should work consistently without toggling between an arrow function and a normal function expression after every server restart.
Parity with Local
Screenshots
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: