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

Experimental Decorator error even after specifying in tsconfig.json #8751

Closed
dbaeumer opened this issue May 23, 2016 · 20 comments
Closed

Experimental Decorator error even after specifying in tsconfig.json #8751

dbaeumer opened this issue May 23, 2016 · 20 comments
Labels
Duplicate An existing issue was already created

Comments

@dbaeumer
Copy link
Member

dbaeumer commented May 23, 2016

From @rajeevkumarsharma on January 1, 2016 15:7

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "noEmitOnError": false,
    "rootDir": ".",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": false,
    "sourceRoot": "",
    "inlineSourceMap": false,
    "inlineSources": false
  },
  "files": [
    "app/app.ts"
  ]
}

It still show error on decorator class

Copied from original issue: microsoft/vscode#1730

@dbaeumer
Copy link
Member Author

This works for me using the latest 0.10.6 build. See attached screen shot:

capture

@rajeevkumarsharma pls ping me if you can reproduce using 0.10.6. Steps would be helpful as well.

@dbaeumer
Copy link
Member Author

From @rajeevkumarsharma on January 7, 2016 6:43

Hi Dirk,

It still persist with 0.10.6 on Linux. Here are some screenshots attacked.

Thanks

screenshot from 2016-01-07 12 06 20
screenshot from 2016-01-07 12 06 35

@dbaeumer
Copy link
Member Author

Duplicates #1740

@dbaeumer
Copy link
Member Author

Closing

@dbaeumer
Copy link
Member Author

From @SergeySolonko on May 20, 2016 12:57

+1
Have same problem.

VScode Version 1.1.1 (1.1.1)
MacOS X El Capitan

screen shot 2016-05-20 at 2 59 21 pm

@dbaeumer
Copy link
Member Author

From @AdamWillden on May 20, 2016 14:48

I also get the same issue but it is inconsistent (1.1.1 Windows)

@dbaeumer
Copy link
Member Author

From @mosho1 on May 22, 2016 10:58

+1, (1.1.1 on windows 10)

@dbaeumer
Copy link
Member Author

Moving to TS team since it still shows up on 1.1.1 which uses 1.8.9 (tsserver)

@mhegazy
Copy link
Contributor

mhegazy commented May 23, 2016

From these snapshots, looks like the file you are getting the error in is not part of the tsconfig.json file.

rest.ts does not seem to be mapped by the tsconfig.json specified, which only lists app/app.ts. if this is the issue, then it is not going to pick up this tsconfig.json as a configuration source.

At this point i do not have much details to piece together a repro. please provide a project i can use to reproduce the issue.

@mhegazy mhegazy added the Needs More Info The issue still hasn't been fully clarified label May 23, 2016
@serhiisol
Copy link

try with this configuration

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "outDir": "../dist/",
    "rootDir": ".",
    "sourceMap": true,
    "target": "es5",
    "inlineSources": true
  },

  "files": [
    "main.ts",
    "typings.d.ts"
  ]
}

I've played a lot with different versions of config, no luck

@serhiisol
Copy link

@dbaeumer I've tried to change typescript.tsdk

"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"

I've used

$ tsc --version
Version 1.8.10

No luck, are you sure that this issue is related to tsserver ?

@kitsonk
Copy link
Contributor

kitsonk commented May 24, 2016

From the screen shots, the file that is showing the errors is ./app/lib/rest.ts but in both the config above and the screenshots, the "files": [] does not include the the displayed file. When a file is not included in the "files" array, they are not part of the project, and vscode will apply default compiler options, which has experimental decorators as false, which would display the errors visible in the screenshot. I highly doubt this has anything to do with tsserver and instead has to do with likely an improperly configured project.

@serhiisol
Copy link

serhiisol commented May 24, 2016

ok, what about next example:

screen shot 2016-05-24 at 2 03 15 pm

@rajeev-kumar-sharma
Copy link

rajeev-kumar-sharma commented May 24, 2016

Hi,

You may use exclude instead files (where u need to put all files reference)
screenshot from 2016-05-24 17 43 36

If you want to use files options only then add all files along with scr/main.ts for those you want to apply these settings .

Here you have added only two files and setting are applied to these files only.

@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2016

@SergeySolonko i can not reproduce this still.. i have your tsconfig.json, and a file and still can not see any issues.

image

Please provide a repro project the exhibits the issue.

@serhiisol
Copy link

serhiisol commented May 24, 2016

@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2016

Thanks. i see the issue now. the problem is in your tsconfig.json there is a missing file. "typings.d.ts". the file does not exist which causes a problem in loading the project. we have fixed this issue in nightly builds, here is the issue: #8334, and the PR: #8504.

Removing the missing file from tsconfig.json, should resolve the issue, or updating to the latest nightly, see https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Nightly%20Builds.md#visual-studio-code

@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2016

Closing in favor of #8334

@mhegazy mhegazy closed this as completed May 24, 2016
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Needs More Info The issue still hasn't been fully clarified labels May 24, 2016
@serhiisol
Copy link

That doesn't make sense, VSCode should read tsconfig and enable all specified options, It shouldn't be related to the project files.
Other words: if experimentalDecorators option is enabled - VSCode should hide that error

@mhegazy
Copy link
Contributor

mhegazy commented May 24, 2016

it is not about VSCode. this is coming from the ts side of things.

The server tries to load the config file. before #8504, if a file was not found, it failed to read the config file, which was a bug. the bug should be fixed in the latest nighties, and it should work now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants