If the TanStack Start dev server prints “Error: Conflicting configuration paths were found for the following routes”, and the conflicting files come in pairs such as index.js and index.tsx, the TypeScript compiler wrote a JavaScript copy next to each of your files. This post shows where the copies come from, and the fix: delete them, and set noEmit so that tsc never writes them again.
What I Was Doing
I was writing How to Link to a Route with Path Params in TanStack Start, with a small TanStack Start app set up by hand as in How to Build a TanStack Start App from Scratch Without the CLI. Its dev server was running in one terminal, and in another I checked the app’s types:
npx tsc
npm notice run tanstack-start-starter@1.0.0 npx
npm notice run 'tsc'
It reported no type errors.
What I Expected
The type check to report type errors, if there were any, and change nothing, while the dev server kept running quietly.
What I Got
The terminal running the dev server printed this error, three times in a row:
VITE v8.3.8 ready in 694 ms
➜ Local: http://localhost:3101/
➜ Network: use --host to expose
➜ press h + enter to show help
5:13:13 PM [vite] (ssr) connected.
Error: Conflicting configuration paths were found for the following routes: "/", "/", "/hello/$name", "/hello/$name".
Please ensure each Route has a unique full path.
Conflicting files:
…/src/routes/index.js
…/src/routes/index.tsx
…/src/routes/hello/$name.js
…/src/routes/hello/$name.tsx
at file://…/node_modules/@tanstack/router-generator/dist/esm/generator.js:143:13

The last line names the part that failed: TanStack Router’s route generator, which reads src/routes and writes the app’s list of routes, src/routeTree.gen.ts. The dev server kept running.
What I Checked
The conflicting files come in pairs: index.js with index.tsx, and $name.js with $name.tsx. The .js files weren’t there before the type check. The app’s tsconfig.json, which has the settings from TanStack’s Build a Project from Scratch (opens in a new tab) guide, has no noEmit option:
{
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ES2022",
"skipLibCheck": true,
"strictNullChecks": true
}
}
Without it, tsc doesn’t only check the code, it also compiles it. TypeScript’s outDir (opens in a new tab) reference says that when no output folder is set, “.js files will be emitted in the same directory as the .ts files”.
Why It Happens
TanStack Start makes a route from every route file in src/routes, and a .js file counts as one. When tsc wrote a .js copy of each route file, every route had two files with the same path, which the route generator refuses: “Please ensure each Route has a unique full path.”
An app made with the TanStack CLI doesn’t run into this, because its tsconfig.json sets "noEmit": true.
The Fix
- Delete the
.jsfiles thattscwrote: each.jsfile with a.tsor.tsxfile of the same name beside it. In this app, they werevite.config.js,src/router.js,src/routeTree.gen.js,src/routes/__root.js,src/routes/index.jsandsrc/routes/hello/$name.js. Delete them in your code editor’s file list. A.jsfile with no.tsor.tsxtwin is your own, so keep it. - Tell
tscto only check the code: intsconfig.json, add"noEmit": truetocompilerOptions. - Stop the dev server with Ctrl+C, and start it again with
npm run dev.
tsconfig.json after step 2:
{
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ES2022",
"skipLibCheck": true,
"strictNullChecks": true,
"noEmit": true
}
}
Don’t skip vite.config.js. Vite looks for vite.config.js before vite.config.ts (DEFAULT_CONFIG_FILES in Vite’s source (opens in a new tab)), so it would keep loading the old copy after you change vite.config.ts.
Or Check the Types with –noEmit
To leave tsconfig.json as it is, add the option to the command each time instead. It checks the types and writes nothing:
npx tsc --noEmit
After the Fix
The dev server starts without the error. Running the type check again writes no files, and the dev server’s terminal stays quiet:
npx tsc
npm notice run tanstack-start-starter@1.0.0 npx
npm notice run 'tsc'

Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Deleting the .tsx files instead of the .js copies | Your own code is gone | Delete only the .js files that have a .ts or .tsx twin |
Keeping vite.config.js | Vite loads it instead of vite.config.ts, so later changes to vite.config.ts don’t apply | Delete vite.config.js too |
Adding noEmit without deleting the copies | The copies stay, and so does the error | Delete them as well |
Troubleshooting
| Problem | Fix |
|---|---|
| The error comes back after the next type check | Check that "noEmit": true is inside compilerOptions. |
| The error still shows after you deleted the copies | Stop the dev server with Ctrl+C and start it again. |
FAQ
Is it safe to set noEmit in a TanStack Start app? Yes. Vite builds the app from the .ts and .tsx files itself, so tsc never needs to write JavaScript. Apps made with the TanStack CLI set it from the start.
What does noEmit do? It stops tsc from writing output files, such as JavaScript, so TypeScript only checks your code (noEmit (opens in a new tab) in the TypeScript reference).
Conclusion
A plain tsc in an app without noEmit writes a .js twin for every file, and TanStack Start then finds two files for each route. Delete the twins, set "noEmit": true, and the type check only checks.
Additional Resources
- noEmit (opens in a new tab) and outDir (opens in a new tab) in the TypeScript reference
- Build a Project from Scratch (opens in a new tab) in the TanStack Start docs
- File-Based Routing (opens in a new tab) in the TanStack Router docs
- Configuring Vite (opens in a new tab)
Related
- TanStack Start Tutorial — Part 4: Dynamic Routes and Path Params
- How to Link to a Route with Path Params in TanStack Start
- How to Build a TanStack Start App from Scratch Without the CLI
- TanStack Start Tutorial for Beginners, every part of the series
TanStack, React and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by TanStack.
0 comments