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

TS server not reload tsconfig when extended tsconfig is installed #51351

Open
vaanpan90 opened this issue Oct 30, 2022 · 1 comment
Open

TS server not reload tsconfig when extended tsconfig is installed #51351

vaanpan90 opened this issue Oct 30, 2022 · 1 comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@vaanpan90
Copy link

Bug Report

My package's tsconfig extends a shared tsconfig from another npm package.
Package tsconfig

{
    "extends": "some-config-package/config/tsconfig.shared.json",
    "compilerOptions": {
        "outDir": "./dist",
        "rootDir": "./src",
    }
}

tsconfig.shared.json in some-config-package

{
    "compilerOptions": {
        "jsx": "react-jsx",
    }
}

With TS server up and running:
When some-config-package is installed, the TS server does not pick up the extended tsconfig automatically and the tsconfig shown TS server log is still:

{
    "compilerOptions": {
        "outDir": "./dist",
        "rootDir": "./src",
    }
}

🔎 Search Terms

TS server, tsconfig

🕗 Version & Regression Information

  • 4.8.4

🙁 Actual behavior

When the extended tsconfig file is installed, TS server will not reload the tsconfig

🙂 Expected behavior

When the extended tsconfig file is installed, TS server should parse the extended tsconfig and reload tsconfig

Question for workaround without restarting TS server

I know restarting TS server solves the issue.
I created a TS server plugin. Is there a way to force TS server to reload tsconfig in plugin? I found this function ts.server.PluginCreateInfo.project.setCompilerOptions. If I call this function from my plugin to manually set compiler options used for TS server, will it cause some unexpected behavior or inconsistent state for TS server?

@MartinJohns
Copy link
Contributor

Related: #17753 / #41493

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Nov 18, 2022
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants