欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

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

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

 Closedrohan-paul opened this issue on 6 Mar 2018 · 4 comments Closed

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

rohan-paul opened this issue on 6 Mar 2018 · 4 comments

Comments

@rohan-paul    

rohan-paul commented on 6 Mar 2018

  • 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 on 6 Mar 2018    

@vscodebot vscodebot bot added the typescript label on 6 Mar 2018@mjbvz    

Contributor

mjbvz commented on 6 Mar 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 needs more info label on 6 Mar 2018@gondomar    

gondomar commented on 8 Mar 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    

Author

rohan-paul commented on 8 Mar 2018

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

@rohan-paul rohan-paul closed this on 8 Mar 2018@manizm    

manizm commented on 12 Apr 2018  
edited             

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

来自  https://github.com/Microsoft/vscode/issues/45071






错误警告消息:“对装饰器的实验支持是一项功能,该功能在将来的发行版中可能会更改” #45071

 关闭rohan-paul 打开了这个问题     on 6 Mar 2018 ·4条评论 关闭

错误警告消息:“对装饰器的实验支持是一项功能,该功能在将来的发行版中可能会更改”#45071

rohan-paul 打开了这个问题     on 6 Mar 2018 ·4条评论

评论

@rohan-paul    

罗汉·保罗 评论 on 6 Mar 2018

  • VSCode版本:1.20.1
    提交f88bbf9日期2018-02-13T15
    :31:21.019Z
    Shell 1.7.9
    渲染器58.0.3029.110
    节点7.9.0
    体系结构x64

  • 操作系统版本:Ubuntu 16.04 64-bit

重现步骤:
创建一个Typescript项目
编写类声明,例如                        

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

对装饰器的实验支持是一项功能,将来的版本中可能会对其进行更改。设置“ experimentalDecorators”选项以删除此警告。                        

我在> vscode中的>文件/首选项/用户设置中有以下内容                        

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

另外,在我项目的根目录下的tsconfig.json文件中,我包括以下选项。                        

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

禁用所有扩展名时会发生此问题吗?:是/否
                       

@vscodebot vscodebot 机器人 分配了 mjbvz 上2018年3月6日    

@vscodebot vscodebot 机器人 添加了 打字稿 标签 上2018年3月6日@mjbvz    

贡献者

mjbvz 评论 上2018年3月6日

在TS文件中,运行TypeScript: Go to project configurationvscode命令。这会打开正确的tsconfig文件吗?                        

@mjbvz mjbvz 添加了 需求更多信息 标签 上2018年3月6日@gondomar    

贡多马 评论 上2018年3月8日

在VSCode中,转到File => Preferences => Settings(或Control +逗号),它将打开User Settings文件。在文件中添加“ javascript.implicitProjectConfig.experimentalDecorators”:true,它应该对其进行修复。它对我有用。                        

@rohan-paul    

作者

罗汉·保罗 评论 上2018年3月8日

感谢@gondomar- 目前已解决了该问题。                        

@rohan-paul rohan-paul 关闭了 上2018年3月8日@manizm    

manizm 评论 上2018年4月12日  
已编辑             

编辑:这基本上是由名为“ Javascript and TypeScript Intellisense”的扩展名引起的问题。禁用后,此问题已解决!                        

我在使用es6装饰器的javascript项目中遇到了这个问题@inject                        

示例代码:                        

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

我的jsconfig.json文件是:                        

    "compilerOptions": {
        "experimentalDecorators": true
    }
}
                       

给出此“装饰器”警告/错误的文件之一在路径中:
./server/service/src/com/tray/communication/push/PushService.js                        

我已经尝试过包括和排除不需要的文件夹等。
我尝试了javascript.implicitProjectConfig.experimentalDecorators: true选项,但是那也不起作用。                        

基本上,我已经花了3个小时试图弄清楚这个问题。.
我的项目中没有本地安装打字稿(因为我根本没有使用过)。                        

任何帮助,将不胜感激。
谢谢                        


来自  https://github.com/Microsoft/vscode/issues/45071

普通分类: