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

```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?

@LeCarbonator
Copy link
Contributor

Since TanStack Start RC has been released, this should probably be added/merged to #1771

@crutchcorn
Copy link
Member

crutchcorn commented Dec 1, 2025

Closing this as we're taking a much deeper look at Form's SSR story (I messed it up bad here, I apologize gang - we'll get it right shortly) and will likely involve some new docs.

Thanks for this otherwise tho! Hope we can land your next PR :)

@crutchcorn crutchcorn closed this Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants