Vscode: Error warning message: "Experimental support for decorators is a feature that is subject to change in a future release"

Created on 5 Mar 2018  Â·  4Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 1.20.1
    Commit f88bbf9137d24d36d968ea6b2911786bfe103002
    Date 2018-02-13T15:31:21.019Z
    Shell 1.7.9
    Renderer 58.0.3029.110
    Node 7.9.0
    Architecture x64
  • OS Version: Ubuntu 16.04 64-bit

Steps to Reproduce:
Create a Typescript project
Write the class declaration, e.g.

export class AuthService {
    constructor(private http: Http) {}
}

Experimental support for decorators is a feature that is subject to change in a future release. Set the ‘experimentalDecorators’ option to remove this warning.

I have the following in my > File/preference/user settings in vscode

{
  "typescript.tsdk": "node_modules/typescript/lib"
}

Also, in tsconfig.json file in the root directory of my project I have include the following options.

{
    "compilerOptions": {
        "experimentalDecorators": true,
        "allowJs": true
    }
}


Does this issue occur when all extensions are disabled?: Yes/No
Yes

needs more info typescript

Most helpful comment

In VSCode, Go to File => Preferences => Settings (or Control+comma) and it will open the User Settings file. Add "javascript.implicitProjectConfig.experimentalDecorators": true to the file and it should fix it. It did for me.

All 4 comments

In the TS file, run the TypeScript: Go to project configuration vscode command. Does this open the correct tsconfig file?

In VSCode, Go to File => Preferences => Settings (or Control+comma) and it will open the User Settings file. Add "javascript.implicitProjectConfig.experimentalDecorators": true to the file and it should fix it. It did for me.

Thanks @gondomar - that solved the issue for now..

EDIT: This was basically the issue caused by an extension called "Javascript and TypeScript Intellisense"..after disabling, the issue is resolved!

I have this issue in a javascript project where I am using es6 decorators like @inject.

example code:

@inject(UserService)
@inject(ApplicationService)
class PushService {
    constructor(userService, applicationService) {
        this.userService = userService;
        this.applicationService = applicationService;
    }
}

my jsconfig.json file is:
{ "compilerOptions": { "experimentalDecorators": true } }
One of the file that gives me this "decorator" warning/error is in the path:
./server/service/src/com/tray/communication/push/PushService.js

I have already tried including and excluding the folders that I wouldn't need etc.
I tried javascript.implicitProjectConfig.experimentalDecorators: true option, but that didn't work either.

Basically, I have wasted my 3 hours trying to figure this thing out..
I don't have typescript installed locally in my project (since I am not using it at all).

Any help would be appreciated.
Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borekb picture borekb  Â·  3Comments

shanalikhan picture shanalikhan  Â·  3Comments

villiv picture villiv  Â·  3Comments

sirius1024 picture sirius1024  Â·  3Comments

biij5698 picture biij5698  Â·  3Comments