Skip to content

Newly created JS files are not added to configured project until server restart #43290

Closed
@andrewbranch

Description

@andrewbranch

Bug Report

🔎 Search Terms

js inferred project restart server

🕗 Version & Regression Information

Tested on 4.3.0-dev.20210316

  • I was unable to test this on prior versions because that seemed like it would take a lot of time

💻 Code

tsconfig.json:

{
  "compilerOptions": {
    "lib": ["es2020"],
    "allowJs": true,
    "checkJs": true,
    "strict": true,
    "noEmit": true,
    "types": ["node"]
  }
}

Open project, then add a new JS file.

🙁 Actual behavior

It doesn’t get checked for errors, and can’t see globals declared in other JS files in the project. TS Server log shows the file added to a new inferred project instead of the configured project. After restarting TS Server, the file is in the configured project as expected.

🙂 Expected behavior

The file gets added to the configured project.

Activity

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

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @andrewbranch@MartinJohns

        Issue actions

          Newly created JS files are not added to configured project until server restart · Issue #43290 · microsoft/TypeScript