Importing generated router file causes nitro startup error
Hi!
I am using tanstack router with vinxi and trying to get ssr working
(before you ask I have reasons for not using start although it is very cool)
When I start the nitro server (via
vinxi start
after building, dev server works fine) I run into this very cryptic error on startup not on request:
I have narrowed it down to the import of my generated file-based router file: https://github.com/ethanniser/sase-template/blob/ssr/client/router.tsx#L9
If I comment this line, the server manages to start (although obviously breaks due to the unresolved variable)
The thing is, this import used in this way is taken directly from the docs: https://tanstack.com/router/latest/docs/framework/react/guide/ssr#router-creation
So I am not really sure what to do...
Any help is greatly appreciated thank youTanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

GitHub
sase-template/client/router.tsx at ssr · ethanniser/sase-template
Contribute to ethanniser/sase-template development by creating an account on GitHub.
2 Replies
correct-apricot•12mo ago
Probably this line? const clientManifest = getManifest("client");
Looking at this example: https://www.brenelz.com/posts/simple-rsc-with-vinxi/
There is a plugin import { serverComponents } from "@vinxi/server-components/plugin";
Might be something to do with it?
I'm just guessing though
like-gold•12mo ago
The TanStack Start SSR config is pretty in-depth for vinxi. You may want to look at our config on github.
packages/start/src/config/index.ts