Skip to content

Commit d534208

Browse files
fix(template-generator): report correct dev port (3001) for tanstack-router (#1089)
The shared webPort formula in the README generator and the CLI post-install note bucketed tanstack-router under 5173, but its vite.config sets server.port: 3001. Every other place in the codebase (vite configs, electrobun DEV_SERVER_PORT template, env-vars CORS/URL logic) already treats tanstack-router as 3001, so both docs reported a URL that didn't match the running dev server. Remove tanstack-router from the 5173 bucket so it falls through to 3001.
1 parent 40a8077 commit d534208

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

apps/cli/src/helpers/core/post-installation.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ export async function displayPostInstallInstructions(
127127
frontend?.includes("native-unistyles");
128128

129129
const hasReactRouter = frontend?.includes("react-router");
130-
const hasTanStackRouter = frontend?.includes("tanstack-router");
131130
const hasSvelte = frontend?.includes("svelte");
132131
const hasAstro = frontend?.includes("astro");
133-
const webPort =
134-
hasReactRouter || hasTanStackRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
132+
// TanStack Router/Start, Next, Nuxt and Solid all dev on 3001; only React Router and SvelteKit use Vite's default 5173.
133+
const webPort = hasReactRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
135134

136135
const betterAuthConvexInstructions =
137136
isConvex && config.auth === "better-auth"

packages/template-generator/src/processors/readme-generator.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,15 @@ function generateReadmeContent(options: ProjectConfig): string {
167167

168168
const isConvex = backend === "convex";
169169
const hasReactRouter = frontend.includes("react-router");
170-
const hasTanStackRouter = frontend.includes("tanstack-router");
171170
const hasNative = hasNativeFrontend(frontend);
172171
const hasReactWeb = frontend.some((f) =>
173172
["tanstack-router", "react-router", "tanstack-start", "next"].includes(f),
174173
);
175174
const hasSvelte = frontend.includes("svelte");
176175
const hasAstro = frontend.includes("astro");
177176
const packageManagerRunCmd = `${packageManager} run`;
178-
const webPort =
179-
hasReactRouter || hasTanStackRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
177+
// TanStack Router/Start, Next, Nuxt and Solid all dev on 3001; only React Router and SvelteKit use Vite's default 5173.
178+
const webPort = hasReactRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
180179

181180
const stackDescription = generateStackDescription(frontend, backend, api, isConvex);
182181

0 commit comments

Comments
 (0)