Skip to content

language server ignores multiple tsconfig files #49210

Closed as not planned
Closed as not planned

Description

@DetachHead

Bug Report

if a project has multiple tsconfig files (eg tsconfig.json and tsconfig.other.json) then the language server seems to ignore the one that isn't named tsconfig.json

🔎 Search Terms

language server multiple tsconfig

🕗 Version & Regression Information

4.8.0-dev.20220522

⏯ Playground github Link

https://github.com/DetachHead/typescript-nodejs-project/tree/global-types-issue

💻 Code

main config

// tsconfig.json
{
    "compilerOptions": {
        "target": "es3"
    },
    "include": ["src/main.ts"]
}
// src/main.ts
export {}

"".replaceAll // error

other config

// tsconfig.json
{
    "compilerOptions": {
        "target": "es2021"
    },
    "include": ["src/other.ts"]
}
export {}

"".replaceAll // error ???

🙁 Actual behavior

the following error in other.ts:

Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.

image

🙂 Expected behavior

no error when accessing the globally defined pm object in either file

Activity

  1. changed the title [-]language server doesn't resolve globally declared types when using `types` property in tsconfig when it has a name other than `tsconfig.json`[/-] [+]language server ignores some compiler options in tsconfig when it it has a name other than `tsconfig.json`[/+] on May 23, 2022
  2. changed the title [-]language server ignores some compiler options in tsconfig when it it has a name other than `tsconfig.json`[/-] [+]language server ignores some compiler options in tsconfig when it has a name other than `tsconfig.json`[/+] on May 23, 2022
  3. changed the title [-]language server ignores some compiler options in tsconfig when it has a name other than `tsconfig.json`[/-] [+]language server ignores multiple tsconfig files[/+] on May 23, 2022
  4. MartinJohns commented on May 23, 2022

    @MartinJohns
    Contributor

    See #33094.

  5. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions