Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: useAction causes silent crash on the client #1681

Open
2 tasks done
shoooe opened this issue Dec 1, 2024 · 4 comments
Open
2 tasks done

[Bug?]: useAction causes silent crash on the client #1681

shoooe opened this issue Dec 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@shoooe
Copy link

shoooe commented Dec 1, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

  • Using useAction with non trivial server side code causes a silent crash on the client and no errors

Expected behavior 🤔

  • Using useAction with server side code simply works

Steps to reproduce 🕹

Repro repo: https://github.com/shoooe/solid-start-blank-page

Context 🔦

I'm trying to call a server-only action using useAction

Your environment 🌎

No response

@shoooe shoooe added the bug Something isn't working label Dec 1, 2024
@shoooe
Copy link
Author

shoooe commented Dec 1, 2024

It's unclear what command I should run exactly for the "Your environment 🌎" section but I'm happy to oblige.

@jackbisceglia
Copy link

i'm also experiencing this from time to time

@brenelz
Copy link
Contributor

brenelz commented Dec 17, 2024

I did a bit of testing and its because your calling a function outside of "use server". I would think it should be able to handle it.

If you move "use server" to the top of the file it works

@jackbisceglia
Copy link

@brenelz I don't think the mode of failure is the concern on this (ie. there are a number of ways to repro this, this just happens to be one of them), but rather the way in which it's failing.

When this is happening in start, assuming the issues I've faced are the same as this, the error just basically nullifies the entire subtree from where it occurs, meanwhile the app continues running as expected above this level of the component tree. This creates an experience where a portion of your app fails to render with no insight as to why, other than the inferring the rough problematic route by what fails to render.

Thus, I don't think the specific 'use server' placement is the real concern here. It may solve this specific issue, but eg. I'm using start on a project with server: false set, and have experienced similar behavior when using actions on client. The common thread between this and the issues I've faced is the action method itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants