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

Update TanStack Start adapter #1023

Open
Balastrong opened this issue Nov 16, 2024 · 4 comments · May be fixed by #1104
Open

Update TanStack Start adapter #1023

Balastrong opened this issue Nov 16, 2024 · 4 comments · May be fixed by #1104
Labels

Comments

@Balastrong
Copy link
Member

The Start demo is currently broken, we should update @tanstack/react-form/start with the new createServerFn APIs

@Balastrong
Copy link
Member Author

Balastrong commented Nov 19, 2024

Also mentioning #1006 as it might be included here to investigate if we can remove @remix-run/node as a direct dependency

@austinm911
Copy link

Hi - would there an update here since Start is now in beta?

@discoverlance-com
Copy link

Any update on this? It seems not to be working.

In this example:



export const handleForm = createServerFn(
  'POST',
  async (formData: FormData, ctx) => {
    try {
      await serverValidate(ctx, formData)
    } catch (e) {
      if (e instanceof ServerValidateError) {
        return e.response
      }

      // Some other error occurred when parsing the form
      console.error(e)
      return new Response('There was an internal error', {
        status: 500,
      })
    }

    return new Response('Form has validated successfully', {
      status: 200,
    })
  },
)

It no longer works and I try to refactor but I don't know what to pass as the ctx, also should we use the validator to run the serverValidate function or we run it in our handler? And the response return no longer seems to work in the handler as the handler does not expect a response to be returned.

@crutchcorn
Copy link
Member

This requires an update on our end. Work is being done in this PR:

#1104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants