T
TanStack6mo ago
continuing-cyan

server only code used in server function but in another file

I have some server code in file a and want to import that and use it in a server function in file b. But for some reason it is still kept in my client bundle..... Do I need to wrap everything in a server function? what is the expected way of working with this?
5 Replies
harsh-harlequin
harsh-harlequin6mo ago
shouldn't be a problem. can you share a complete minimal example?
continuing-cyan
continuing-cyanOP6mo ago
I fixed it by using the use server directive at the top of file a But I'll try to get a minimal example sometime this week I'm super busy atm as can be seen from my barely coherent initial description XD
harsh-harlequin
harsh-harlequin6mo ago
that should not be necessary in start really
continuing-cyan
continuing-cyanOP6mo ago
Weird then. its a project I started like 4 days ago, barely any code
harsh-harlequin
harsh-harlequin6mo ago
so even simpler to provide that reproducer 😁

Did you find this page helpful?