Ensure all server entry exports are functions (#47364)Co-authored-by:…
Ensure all server entry exports are functions (#47364)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> When using a "use server" module, only exporting async functions is permitted. However, since we cannot perform static analysis on all exported value types (e.g., `export const foo = condition ? A : B`), we have added a runtime ensure function to validate that these are indeed valid functions. By implementing this, we can prevent any strange errors like "Can't access $$typeof of undefined or null" that may arise when exporting `undefined` or `null` from a server entry. Moreover, this measure helps avoid any potential mistakes that may occur. fix NEXT-865 ([link](https://linear.app/vercel/issue/NEXT-865)) Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment