Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TrevorBurnham opened this issue Mar 14, 2025 · 1 comment
Open

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

TrevorBurnham opened this issue Mar 14, 2025 · 1 comment
Labels
revisit-after-devinxi start Everything about TanStack Start

Comments

@TrevorBurnham
Copy link

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

@SeanCassiere SeanCassiere added start Everything about TanStack Start revisit-after-devinxi labels Mar 15, 2025
@SeanCassiere
Copy link
Member

This warning is likely being thrown by the older version of esbuild that's in Vinxi's dependencies.

Testing this with the target set to "ES2023" and with it also being included in the "lib" option of tsconfig.json in the "devinxi" branch does not yield this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
revisit-after-devinxi start Everything about TanStack Start
Projects
None yet
Development

No branches or pull requests

2 participants