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

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

Closed
rohan-paul opened this issue Mar 5, 2018 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster typescript Typescript support issues

Comments

@rohan-paul
Copy link

  • VSCode Version: 1.20.1
    Commit f88bbf9
    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

@vscodebot vscodebot bot assigned mjbvz Mar 5, 2018
@vscodebot vscodebot bot added the typescript Typescript support issues label Mar 5, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 6, 2018

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

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Mar 6, 2018
@gondomar
Copy link

gondomar commented Mar 8, 2018

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.

@rohan-paul
Copy link
Author

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

@manizm
Copy link

manizm commented Apr 12, 2018

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

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

4 participants