Skip to content

Root tsconfig.json is used in addition to tsConfigPaths #3776

Closed
@TrevorBurnham

Description

@TrevorBurnham

Which project does this relate to?

Start

Describe the bug

I'm trying to add TanStack Start to an existing project where the root tsconfig.json declares

"target": "ES2023",

That causes vinxi to emit a warning when starting the dev server:

vinxi v0.5.3
▲ [WARNING] Unrecognized target environment "ES2023" [tsconfig.json]

    tsconfig.json:13:14:
      13 │     "target": "ES2023",
         ╵               ~~~~~~~~

"No problem," I figured, "I'll just create a different tsconfig.json and update my app.config.ts to point to it":

// in app.config.ts
export default defineConfig({
  vite: {
    plugins: [
      tsConfigPaths({
        projects: ['./app/tsconfig.json'],
      }),
    ],
  },
})

However, after setting up that app/tsconfig.json, I still get the same warning, which references the root tsconfig.json.

I thought this might be because the root tsconfig.json is still used for app.config.ts itself, but I observe the same behavior if I change it to app.config.js. Additionally, I notice that changing either tsconfig.json or app/tsconfig.json triggers a dev server restart.

Your Example Website or App

https://codesandbox.io/p/devbox/modern-shape-48wcmm?file=%2Fapp.config.ts

Steps to Reproduce the Bug or Issue

Use the CodeSandbox above, or recreate it with these steps:

  1. Fork the TanStack Start Basic example.
  2. Copy the root tsconfig.json into the src/ dir.
  3. Modify the tsConfigPaths options in app.config.ts to point to ./src/tsconfig.json.
  4. In the root tsconfig.json, change target to "ES2023".

Expected behavior

When tsConfigPaths references a non-root tsconfig file, I expect the root tsconfig.json to be irrelevant.

Screenshots or Videos

No response

Platform

Observed on both my Mac and the CodeSandbox. Here are the dependency versions:

"dependencies": {
  "@tanstack/react-router": "^1.114.17",
  "@tanstack/react-router-devtools": "^1.114.21",
  "@tanstack/react-start": "^1.114.19",
  "react": "^19.0.0",
  "react-dom": "^19.0.0",
  "redaxios": "^0.5.1",
  "tailwind-merge": "^2.6.0",
  "vinxi": "0.5.3"
},
"devDependencies": {
  "@types/node": "^22.5.4",
  "@types/react": "^19.0.8",
  "@types/react-dom": "^19.0.3",
  "postcss": "^8.5.1",
  "autoprefixer": "^10.4.20",
  "tailwindcss": "^3.4.17",
  "typescript": "^5.7.2",
  "vite-tsconfig-paths": "^5.1.4"
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions