Skip to content

formatter: LSP falls back to wrong oxfmt config when in workspace #20237

@Blitz2145

Description

@Blitz2145

After upgrading oxfmt, it started trying to load vite.config.ts for all vscode roots in our workspace. This meant that when it fails to load one of the config files, it fallsback to a default config for all roots instead of only the failing path. We have an existing working oxfmt config in a different folder, so this seems like a new regression.

macOS 26.3.1
node v24
oxfmt v0.38

2026-03-11 11:58:17.245 [info] 2026-03-11T15:58:17.245230Z  INFO tokio-rt-worker oxc_language_server::backend: initialize: Some([WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-1>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-2>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-3>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-4>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-5>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-6>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-7>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-8>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-9>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>/<service-10>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/<workspace>", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true)} }])
2026-03-11T15:58:17.245264Z  INFO tokio-rt-worker oxc_language_server::backend: oxfmt version: 0.38.0

2026-03-11 11:58:17.258 [info] [Error - 11:58:17 AM] Server process exited with code 0.
2026-03-11 11:58:17.281 [info] 2026-03-11T15:58:17.281038Z  WARN tokio-rt-worker oxfmt::lsp::server_formatter: Failed to build config resolver: /<workspace>/<service-8>/vite.config.ts
Ensure the file has a valid default export of a JSON-serializable configuration object., falling back to default config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions