Skip to content

LSP loads vite.config.ts with the server's cwd as root #3217

Open

Description

@ohkimur

Describe the bug

oxlint/oxfmt load vite.config.ts without a root (apps/shared/src-js/vite_plus_config.ts):

resolveConfig({ configFile: path }, "build")

Vite falls back to process.cwd(). In a multi-root workspace (oxc-project/oxc-vscode#418) that's another repo, so plugins resolve against it. TanStack Start fails:

Could not resolve entry for router entry: router in app-a/src

The failing project is plain Vite (no vite-plus), so lazyPlugins() from #1756 isn't available.

Fix: resolveConfig({ root: dirname(path), configFile: path }, "build").

Reproduction

No repo. Steps below.

Steps to reproduce

  1. Workspace with a Vite+ repo first, then a Vite + TanStack Start repo.
  2. Open in VS Code with the Oxc extension.
  3. Loading the second repo's config fails.

System Info

vp v1.3.0 (vite 8.3.4, oxlint 1.88.0, oxfmt 0.73.0)
Node 24.22.1, bun 1.4.4, macOS 27.0.1
Oxc VS Code 1.64.1

Used Package Manager

bun

Logs

Failed to load config: app-c/vite.config.ts
Error: Could not resolve entry for router entry: router in app-a/src
    at resolveEntry (@tanstack/start-plugin-core/dist/esm/resolve-entries.js:30:45)
    at BasicMinimalPluginContext.config (@tanstack/start-plugin-core/dist/esm/vite/plugin.js:55:29)
    at runConfigHook (app-a/.../@voidzero-dev/vite-plus-core/dist/vite/node/chunks/...)

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions