experimentalDecorators Typescript warning always present
From @giacomorebonato on June 23, 2016 18:53
- VSCode Version: 1.3.0-insider
- OS Version: El Capitan
Steps to Reproduce:
- Create a Typescript project
- Use decorators (I am using Mobx)
I keep seeing the warning:
[ts] Experimental suport for decorators is a feature that is subject to chang in a future release. Set the 'experimentalDecoratos' option to remove this warning.
Where should I set this option? Because my tsconfig.json should be right
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": false,
"isolatedModules": false,
"jsx": "react",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noLib": false,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "./dist/"
},
"exclude": [
"client",
"node_modules",
"typings/browser",
"typings/browser.d.ts"
]
}
Copied from original issue: Microsoft/vscode#8069
I could not get this to reproduce on a simple project. can you share more context.

What version of TS are you using? are you using the nightly build (https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Nightly%20Builds.md#visual-studio-code) ?
I think this is potentially a duplicate of #8905.
I am using "typescript": "^1.8.10" . Should I use a dev one?
looks like a duplicate of #8905 then. can you give the nightly a try and see if it resolves the issue for you? here are the instructions: https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Nightly%20Builds.md#visual-studio-code.
Problem still present with "typescript": "^2.0.0-dev.20160628" "tslint": "^3.12.0-dev.2"
@giacomorebonato are you running El Capitan with case-sensitivity on your drive? @laurelnaiad was running into this over Gitter.
My details:
- case sensitive HFS+ on El Capitan
- node 5.12.0
- typescript Version 2.0.0-dev.20160705
- VSCode version 1.2.1
Peculiarities:
- experimentalDecorators warnings
- paths that should be resolvable based on baseUrl setting of
"."are not properly resolved
I cannot say when either of these issues might have developed, since I've been using atom-typescript throughout -- every time I've tried to use VSCode I've not been able to get it to work, though I don't know if the same issue has been the reason each time.
Sorry for all the mess.. I don't know why I was excluding all client code in tsconfig... Everything works know. Thanks for the support.
@laurelnaiad looks like your tsconfig.json has errors or the file you are working on is not included in this tsconfig.json (either excluded or not in the folder).
thanks @giacomorebonato for getting back to us on this. closing.
@laurelnaiad looks like your tsconfig.json has errors or the file you are working on is not included in this tsconfig.json (either excluded or not in the folder).
Hi @mhegazy. Hmm. As far as I know, those statements aren't true.
{
"externalTranspiler": {
"name": "babel",
"options": {}
},
"buildOnSave": false,
"compileOnSave": false,
"indentSize": 2,
"tabSize": 2,
"compilerOptions": {
"suppressOutputPathCheck": true,
"baseUrl": ".",
"noEmit": false,
"declaration": false,
"moduleResolution": "node",
"module": "commonjs",
"target": "es6",
"allowNonTsExtensions": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"jsx": "react",
"removeComments": false,
"noLib": false,
"preserveConstEnums": false,
"suppressImplicitAnyIndexErrors": true
},
"filesGlob": [
"app/**/*.ts"
],
"files": [
"app/routing.ts"
],
"atom": {
"rewriteTsconfig": false
}
}
I abbreviated the files and filesGlob. The first symptom -- which I only see in VSCode, not elsewhere -- is that a module like app/routing can't be located by vs code at 'app/routing' . But it can via a relative path './app/routing'.
... and the second symptom is this ghost experimentalDecorators error -- again, only in VSCode.
I've tried it with or without the atom and externalTranspiler properties, just in case they were cause the issue, to no effect.
Is the above tsconfig invalid? (I mean, I don't mean to be pushy, but we've been building this app for a couple of months now, have a team of developers building it, people evaluating it, etc.. somehow it's all getting built with this tsconfig, just not in VScode 😄 )
So long as tsc works with the tsconfig.json, that file should be valid.
By the way @laurelnaiad, do you have a .vscode file? Just wondering if that could throw things off
Wow, ok... tsc was unhappy.
error TS5023: Unknown compiler option 'suppressOutputPathCheck'.
error TS5023: Unknown compiler option 'allowNonTsExtensions'.
I removed them, and it's much happier. It's odd that we have been going for months with those settings in place and building through gulp with no issues using our build process, but glad that's sorted out now. Thank you!
Glad it is resolved.
Ah, now I remember: suppressOutputPathCheck is necessary in at least one of my projects to prevent a TypeScript: emit failed problem that results in no output. It would be awesome if that option would be allowed from tsc command line and vscode. Is there a reason that the suppressOutputPathCheck is (apparently) not really supposed to be there? To be honest, I'm not really sure of the finer details of why it's necessary to build my project, but I guess I'm caught in the middle for some reason.
This should not be used. If u r using it because of a gulp-typescript issue, then it should be addesed there. If this is a TS issue, I would love to hear more about the root cause and see what we can do to solve the issue. If you are using it because one of your input files is an output file as well, then I would expect that to be an easy fix.
If you are using it because one of your input files is an output file as well, then I would expect that to be an easy fix.
Well I do have several projects, and a few of them are interdependent. Is that what you mean by input files being output files as well? Within any single project, there aren't (to my knowledge), any such cases, but one project generates d.ts files that another project references. Is that my problem?
Sorry, you gave three possible reasons why I might be using that flag... the reason I'm using it is that back when I was trying to figure out why the project wouldn't compile in atom-typescript, I tracked down this flag in the source code, and it looked perfectly designed for enabling me to move forward! :) , so I added it to atom-typescript's schema to allow it, thinking it was just missing from atom-typescript's schema. Ugh. I didn't realize the flag was intended to be private. I'm sorry about that. Still not clear on what I'm doing fundamentally wrong here with the project dependencies.
