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

Server action can't find variable #712

Open
AlbertSabate opened this issue Jan 19, 2025 · 7 comments · Fixed by #713
Open

Server action can't find variable #712

AlbertSabate opened this issue Jan 19, 2025 · 7 comments · Fixed by #713
Assignees
Labels
bug Something isn't working high

Comments

@AlbertSabate
Copy link
Collaborator

Describe the bug
A server action can't find a variable that is not declared on the server action. For example:

I declare in the component a variable named lala. Then this variable is used in the render but not on the server action. Server action will throw an error saying can't find the variable, even though is not used in the server action.

Should not throw.

@aralroca
Copy link
Collaborator

This is solved in 0.2.4-canary.1

@AlbertSabate
Copy link
Collaborator Author

Still not working when there is async operations in the component.

so if you do
const lala = await fetch();

lala will not be found in the server action.

@AlbertSabate AlbertSabate reopened this Jan 21, 2025
@aralroca
Copy link
Collaborator

lala is used inside the server action?

@AlbertSabate
Copy link
Collaborator Author

No, it is not used in the server action. However If I use lala in the server actions works as expected.

@aralroca
Copy link
Collaborator

At what point does it crash? when executing the server action? or after the execution of the server action before returning the response?

@AlbertSabate
Copy link
Collaborator Author

Crashes when executing the action

@aralroca aralroca added the high label Feb 9, 2025
@aralroca
Copy link
Collaborator

aralroca commented Feb 9, 2025

Ok, we are going to prioritize this one

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

Successfully merging a pull request may close this issue.

2 participants