T
TanStack2w ago
absent-sapphire

Running `vite build` doesn't create a .output folder anymore in RC

I've been able to migrate my project to RC and everything's running fine but when I tried building it, a .output folder wasn't created, but in the docs the output folder is still used. Any tips about how I can build and start my app? Here's my vite config
import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";

export default defineConfig({
server: {
port: 3000,
},
plugins: [tailwindcss(), tsConfigPaths(), tanstackStart(), viteReact()],
});
import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";

export default defineConfig({
server: {
port: 3000,
},
plugins: [tailwindcss(), tsConfigPaths(), tanstackStart(), viteReact()],
});
7 Replies
unwilling-turquoise
unwilling-turquoise2w ago
If you don’t need Nitro, you can use srvx to serve your project. You can use the Nitro v2 plugin the same way as before the RC version , create an .output folder. "start": "pnpx srvx --prod -s ../client dist/server/server.js"
absent-sapphire
absent-sapphireOP2w ago
This worked! Thank you so much!
conscious-sapphire
conscious-sapphire2w ago
Nice, I didn't know about srvx. The docs have not been updated to the release.
genetic-orange
genetic-orange7d ago
This is helping me with the same problem, but I can't get the client directory right. I've got pnpx srvx --prod -s dist/client dist/server/server.js, and I get the below output:
➜ Listening on: http://localhost:3000/ (all interfaces)
λ Server handler: ./dist/server/server.js
∘ Static files: (add public/ dir to enable)
➜ Listening on: http://localhost:3000/ (all interfaces)
λ Server handler: ./dist/server/server.js
∘ Static files: (add public/ dir to enable)
The server is accessible, but none of the static files are available. I've tried manually moving the contents of dist/client to dist/client/public and that still doesn't work. If I'm reading the srvx docs right, the -s dist/client should be configuring it to consider that the as public directory? But the message on Static files makes it seems like it's not finding anything configured. Never mind--should have taken the command verbatim. The client path is relative to the server file.
yappiest-sapphire
yappiest-sapphire7d ago
are you able to get the static assets to work it returns a 404 for me path is correct
No description
genetic-orange
genetic-orange7d ago
Is the trailing / in the static files affecting anything?
yappiest-sapphire
yappiest-sapphire7d ago
dont think so the command i use is: "preview": "dotenv -- srvx --prod -s ../client dist/server/server.js", it just seems to not run the middleware as i see my not found component being rendered

Did you find this page helpful?