Server Functions cannot be nested in other blocks or functions

I just tried to upgrade to SolidStart 1.1.x. I started getting the Server Functions cannot be nested in other blocks or functions everywhere. I read this post by @Atila . @Atila you said: "I'm still working on a better DX, either to migrate or to add code-extraction to the plugin." Does that mean my code should eventually work again? Afterall, "use server" was designed to let you to nest server functions, right? I'm not trying to complain, I'm just trying to save myself two refactors if possible. If my code as written will eventually work again, I'll skip this update and wail until "use server" works again. Thanks, Chris
GitHub
[Bug?]: (v1.1.0) Unable to inline server functions in components ·...
Duplicates I have searched the existing issues Latest version I have tested the latest version Current behavior 😯 Previously we were able to inline server functions directly in components. Since v1...
1 Reply
hannus
hannus2mo ago
here is my methods: 1. add string parameter to the action. for instance:
const testAction = action(async()=> { }, 'test-action')
const testAction = action(async()=> { }, 'test-action')
2. remove "use server" in the top of the file. Keep "use server" in each server function. it works for me.

Did you find this page helpful?