lib-starter icon indicating copy to clipboard operation
lib-starter copied to clipboard

Warning of experimental support for decorators

Open philjones88 opened this issue 8 years ago • 7 comments

severity: 'Error' message: 'Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.'

philjones88 avatar May 24 '17 09:05 philjones88

are you getting this error in VS code? or build time? I believe it has to do with the files array in the tsconfig and not putting in a rootDir in there are well.

Hendrixer avatar May 24 '17 16:05 Hendrixer

In VS Code (insiders).

I don't get this on other projects where I used your angular-starter project so maybe it's a difference in the tsconfig files?

https://github.com/AngularClass/angular-starter/blob/master/tsconfig.json

philjones88 avatar May 25 '17 15:05 philjones88

right, i can confirm it has to do with the lack of "rootDir" in the tsconfig

Hendrixer avatar May 25 '17 19:05 Hendrixer

I don't know if that's right? I use the angular-starter tsconfig.json in our product and we don't get this warning? Let me test what settings from the angular-starter tsconfig.json fix it :)

philjones88 avatar May 25 '17 20:05 philjones88

in my case it was. The real issue is when you have a file not being included by the tsconfig. This can be from rootDir, excludes, or files.

Hendrixer avatar May 25 '17 20:05 Hendrixer

I can't replicate it tonight. VS Code has now decided that in lib.component.ts that the template property is missing even though it's right there! :(

file: 'file:///Users/phil/Documents/Projects/lib-starter/src/lib.component.ts'
severity: 'Error'
message: 'Component LibComponent must have a template or templateUrl'
at: '3,2'
source: 'Angular'

philjones88 avatar May 25 '17 20:05 philjones88

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.

AlirezaEbrahimkhani avatar Jul 28 '20 08:07 AlirezaEbrahimkhani