Bug: compiler error on arrow function implicit return in server functions - Invariant failed: createServerFn must be called with a function that is marked with the 'use server' pragma. #2441
Invariant failed: createServerFn must be called with a function that is marked with the 'use server' pragma. Are you using the @tanstack/router-plugin/vite ?
As a user I expect it to support javascript syntax correctly, which means it should support any variant of functions that we pass to be considered a fully javascript compatible.
Which project does this relate to?
Start
Describe the bug
This issue is a follow up for https://github.com/TanStack/router/discussions/2434 discussion:
This server function:
results in :
while it works for:
Your Example Website or App
https://github.com/TanStack/router/discussions/2434
Steps to Reproduce the Bug or Issue
Expected behavior
As a user I expect it to support javascript syntax correctly, which means it should support any variant of functions that we pass to be considered a fully javascript compatible.
Screenshots or Videos
Platform
Additional context
No response