T
TanStack•3mo ago
variable-lime

SSR and Static Generation In latest Version? 1.121

Since updating to this version, it seems we have ditched app.config.ts in favoure of a vite.config.ts However, all of the commented stuff is now invalid and doesn't work:
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";

export default defineConfig({
// tsr: {
// appDirectory: "app",
// },
server: {
// preset: "bun",
// prerender: {
// routes: ["/", "/cv"],
// crawlLinks: true,
// },
},
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
],
});
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";

export default defineConfig({
// tsr: {
// appDirectory: "app",
// },
server: {
// preset: "bun",
// prerender: {
// routes: ["/", "/cv"],
// crawlLinks: true,
// },
},
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
],
});
Also in my ssr.tx I have errors like:
Cannot find module '@tanstack/react-start/router-manifest' or its corresponding type declarations. (ts 2307)
Cannot find module '@tanstack/react-start/router-manifest' or its corresponding type declarations. (ts 2307)
Also the SSR page is a 404: https://tanstack.com/start/latest/docs/framework/react/ssr
6 Replies
adverse-sapphire
adverse-sapphire•3mo ago
the tsr and server now go inside the plugin, which you seem to be missing:
export default defineConfig({
plugins: [
tanstackStart({
tsr: {
srcDirectory: "apps/web-app/src",
verboseFileRoutes: false,
quoteStyle: "double",
},
public: {
dir: "apps/web-app/public",
},
}),
],
export default defineConfig({
plugins: [
tanstackStart({
tsr: {
srcDirectory: "apps/web-app/src",
verboseFileRoutes: false,
quoteStyle: "double",
},
public: {
dir: "apps/web-app/public",
},
}),
],
addDirectory is now srcDirectory
variable-lime
variable-limeOP•3mo ago
ah how about SSR and prerendering? thx btw almost there 🙂
export default defineConfig({
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
tanstackStart({
tsr: {
srcDirectory: "app",
},
server: {
// still broken: preset: "bun",
prerender: {
routes: ["/", "/cv"],
crawlLinks: true,
},
},
}),
],
});
export default defineConfig({
plugins: [
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
tanstackStart({
tsr: {
srcDirectory: "app",
},
server: {
// still broken: preset: "bun",
prerender: {
routes: ["/", "/cv"],
crawlLinks: true,
},
},
}),
],
});
oh wait, no
Object literal may only specify known properties, and 'prerender' does not exist in type '{ entry?: string | undefined; }'. (ts 2353)
Object literal may only specify known properties, and 'prerender' does not exist in type '{ entry?: string | undefined; }'. (ts 2353)
tanstackStart({
tsr: {
srcDirectory: "app",
},
target: "bun",
prerender: {
enabled: true,
filter: () => true,
crawlLinks: true,
},
}),
tanstackStart({
tsr: {
srcDirectory: "app",
},
target: "bun",
prerender: {
enabled: true,
filter: () => true,
crawlLinks: true,
},
}),
Looking a bit healthir But still the ssr.tsx is broken and there' sno instructions to fix it apparently it doesn't need that now? Still can't get it to output static anywhere
ambitious-aqua
ambitious-aqua•3mo ago
I think it's server.tsx now?
conscious-sapphire
conscious-sapphire•3mo ago
yes but that file is optional. if you dont have it, start will use a default one
ambitious-aqua
ambitious-aqua•3mo ago
Yeah wasn't sure if it was customized at all
variable-lime
variable-limeOP•3mo ago
hmm yeah nothing I do seems to get it to output any html currently running my site on bun runtime and it works, but be nice if the site could work 100% static

Did you find this page helpful?