Skip to content

Conversation

melkir
Copy link

@melkir melkir commented May 14, 2025

This seems to be required for Tanstack Start, following the guide by putting everything on my route and ended-up having this error

[vite] (ssr) Error when evaluating SSR module <root>/src/routes/index.tsx?tsr-directive-use-server=: Cannot access 'formOpts' before initialization

This is required for Tanstack Start otherwise the following error appears
```
[vite] (ssr) Error when evaluating SSR module <root>/src/routes/index.tsx?tsr-directive-use-server=: Cannot access 'formOpts' before initialization
```
@melkir melkir changed the title Update ssr.md fix(doc): update ssr.md for tanstack start May 14, 2025
@@ -25,7 +25,7 @@ This section focuses on integrating TanStack Form with TanStack Start.
Let's start by creating a `formOption` that we'll use to share the form's shape across the client and server.

```typescript
// app/routes/index.tsx, but can be extracted to any other path
// src/utils/form-isomorphic.ts, but can be extracted to any other path
Copy link
Author

@melkir melkir May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could be a good comment for specifying that we shouldn't put the isomorphic code on routes file?

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

Successfully merging this pull request may close these issues.

1 participant