I receive the warning...
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to remove this warning.
... even though my compilerOptions in tsconfig.json have the following settings:
"emitDecoratorMetadata": true, "experimentalDecorators": true,
What is weird is that some random classes that use decorators do not show that warning but the rest in the same project do.
What could cause such behavior in the TypeScript compiler?
Decorators provide a way to add both annotations and a meta-programming syntax for class declarations and members. Decorators are a stage 2 proposal for JavaScript and are available as an experimental feature of TypeScript. NOTE Decorators are an experimental feature that may change in future releases.
Experimental Support For Decorators Is A Feature That Is Subject To Change In A Future Release. Set The 'Experimentaldecorators' Option In Your 'Tsconfig' Or 'Jsconfig' To Remove This Warning. Ts(1219) Angular With Code Examples.
Solving warning: “Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning”
The solution above: "In Visual Code Studio Go to File >> Preferences >> Settings, Search "decorator" in search field and Checking the option JavaScript › Implicit Project Config: Experimental Decorators" solved the problem.
Although VS Code is a great editor for TypeScript projects, it needs a kick every now and again. Often, without warning, certain files cause it to freak out and complain. Mostly the fix seems to be to save and close all open files, then open tsconfig.json
. After that you should be able to re-open the offending file without error. If it doesn't work, lather, rinse, and repeat.
If your tsconfig.json
specifies its source files using the files
array, IntelliSense will only function correctly if the file in question is referenced such that VS Code can find it by traversing the input file tree.
Edit: The 'reload window' command (added ages ago now) should solve this problem once and for all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With