Astro Example
Anyone have an example of how to get Tanstack Router SSR working with Astro? There was an old example on the docs site that seems to have been removed, but it didn't use many of 1.0s APIs so I'm not able to get it working.
9 Replies
national-gold•2y ago
Following this thread, I am just exploring the same thing and still have no idea how to make the SSR work
stormy-goldOP•2y ago
I literally JUST got it working a few minutes ago. Just pushed an example here: https://github.com/alrightsure/tanstack-router-astro-ssr-example
GitHub
GitHub - alrightsure/tanstack-router-astro-ssr-example
Contribute to alrightsure/tanstack-router-astro-ssr-example development by creating an account on GitHub.
stormy-goldOP•2y ago
Haven't had a lot of time to test and I'm about to head to bed, but it might be a good jumping off point.
national-gold•2y ago
TIL that we can use entry-client.tsx on astro. Is it documented in the Astro docs?
stormy-goldOP•2y ago
No it’s just being called as an inline script in __root.tsx. It could be called anything, I just left it as-is.
national-gold•2y ago
Ah, skipped noticing that part
stormy-goldOP•2y ago
Just updated it with TRPC working, had the port typed in backwards on the trpc client for like 2 hours of debugging lol
rare-sapphire•2y ago
This is cool.
Would love an example in our docs or at least as sidebar link to this one.
stormy-goldOP•2y ago
I’d be happy to help! I did end up running into some issues with the css loading that was a little over my head, so I’m not sure if what I’m doing here is actually the best approach.