Skip to content

VSCode loses tsconfig settings #12618

@waderyan

Description

@waderyan

From @sam-s4s on August 19, 2016 0:6

  • VSCode Version: 1.4.0
  • OS Version: Windows 10

I'm working with Angular2 and Typescript, and VSCode often loses my tsconfig. The file is still there in the explorer, but its settings are ignored.

For example, it will give me this error on my AppComponent class (which has a Component decorator)...

[ts] 
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
class AppComponent

And also, in my pollyfills.ts file, I'm doing a require('zone.js/dist/zone.js'); and I get the following error:

[ts] 
Cannot find name 'require'.
any

But, as you can see, my tsconfig.json is as follows:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": false,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "strictNullChecks": false
    },
    "awesomeTypescriptLoaderOptions": {
        "useWebpackText": true
    }
}

My directory structure is as follows:

root/
root/package.json
root/tsconfig.json
root/typings.json
root/webpack.config.js
root/app/polyfills.ts
root/app/main.ts
root/app/app.component.ts
root/app/index.html

I'm not sure if it's at all related to the fact that I have awesomeTypescriptLoaderOptions following compilerOptions, and VSCode is getting confused?

I have found that sometimes if I modify or remove and re-add the tsconfig.json file, VSCode will then pick everything up correctly - but then at some point later (in this case it was about 15 minutes, no restarts of the app) it will decide to drop everything again...

Copied from original issue: microsoft/vscode#10683

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions