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

tsconfig.json does not work with VS 2015 #3124

Closed
OnurGumus opened this issue May 12, 2015 · 35 comments

Comments

@OnurGumus
Copy link

commented May 12, 2015

I am trying to give options to typescript namely trying tell how to load modules from VS. For new ASP.NET 5 templates this option simply not available, worse typescript 1.5 does not honor tsconfig.json either so what should I do ?

@CyrusNajmabadi

This comment has been minimized.

Copy link
Contributor

commented May 12, 2015

tsconfig.json files are not currently working in VS2015. It's something @paulvanbrenk is working on.

@OnurGumus

This comment has been minimized.

Copy link
Author

commented May 12, 2015

Any work around for the time being? I need to specify modules to AMD.

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented May 12, 2015

No guaranteed workaround, you can try adding a TypeScriptModuleKind element to a propertygroup, with amd or commonjs specified.. not sure if that gets correctly communicated to the compiler.

@paulvanbrenk paulvanbrenk added this to the TypeScript 1.5.2 milestone May 12, 2015

@paulvanbrenk paulvanbrenk added the Bug label May 12, 2015

@paulvanbrenk paulvanbrenk self-assigned this May 12, 2015

@OnurGumus

This comment has been minimized.

Copy link
Author

commented May 12, 2015

Thanks that seems to work.

@boxofnotgoodery

This comment has been minimized.

Copy link

commented May 17, 2015

+1 for this to work in VS2015 RC without workarounds.
I really enjoy the experience from VS Code

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented May 18, 2015

This will work in the final release of VS 2015.

@mhegazy

This comment has been minimized.

Copy link

commented May 19, 2015

Updating the label to suggestion as this is not a bug level change; this does not change the plan of shipping this in the next public VS release.

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented May 20, 2015

Checked in the code to enable this scenario in VS 2015

@afaayerhan

This comment has been minimized.

Copy link

commented Jul 20, 2015

just got VS 2015 RTM now but the tsconfig is not working. and when you change module system it just does not work. it defaults to commonjs. and if you remove TypeScriptModuleKind it cannot compile without --module flag

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2015

What kind of project are you using? For VS 2015 RTM tsconfig.json based configuration is only supported for ASP.NET v5 and Cordova Projects.

@afaayerhan

This comment has been minimized.

Copy link

commented Jul 20, 2015

njsproj

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2015

Yes, that's a currently unsupported project type. The behavior you're seeing is expected. We are planning support for additional project types, but nothing concrete at the moment.

@afaayerhan

This comment has been minimized.

Copy link

commented Jul 20, 2015

thanks. it would be great if njsproj would be supported and also for tsconfig files sync with ItemGroup typescriptCompile includes.

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2015

That's exactly one of the problems we run into.. we don't want to have to keep the 2 files in sync. As long as the files are edited in Visual Studio we would be ok, but the moment one of the files is edited outside of Visual Studio the files would be out of sync and we would have a problem getting them back in agreement.

@Jak3b0

This comment has been minimized.

Copy link

commented Jul 24, 2015

I'm trying to use the tsconfig.json inside an empty ASP.NET vNext project and it is not being used. I have to set the properties inside a PropertyGroup in the .xproj file... Is there any steps I need to do in order to make it work? @paulvanbrenk, as you mentionned in a previous reply, this should work right?

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Jul 24, 2015

What does your project look like?
The following setup should work:

/project root
    /wwwroot
    /scripts
        -tsconfig.json
        -*.ts
@jannavarro

This comment has been minimized.

Copy link

commented Aug 6, 2015

@paulvanbrenk you mentioned "For VS 2015 RTM tsconfig.json based configuration is only supported for ASP.NET v5 and Cordova Projects."

In VS 2015 there is a project for Html Application with TypeScript. Will this be supported?

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2015

We are looking at making the experience better for all projects, including the Html App with TypeScript.. not sure about the time line though.

@dazinator

This comment has been minimized.

Copy link

commented Sep 15, 2015

tsconfig.json is not being honored for me (new ASP.NET v5 project.)
I have had to add the ms build properties to the xproj.
Does the tsconfig.json file have to be placed under a /scripts directory as suggested?

@mhegazy

This comment has been minimized.

Copy link

commented Sep 15, 2015

@dazinator, for now it needs to be under the scripts folder. but we have a fix for this in the next release. so bear with us for a little bit longer.

@dazinator

This comment has been minimized.

Copy link

commented Sep 15, 2015

@mhegazy ok thats fine - will give that a try. Thanks :)

@oryol

This comment has been minimized.

Copy link

commented Nov 4, 2015

I use latest (1.6.3 TypeScript language services), VS 2015 and ASP .Net Betta8. I have FrontendApp folder in the root of web project with tsconfig.json. It contains compiler options and links to files with TS definitions. I also use WebPack + ts-loader to build frontend application and it builds successfully.

But Visual Studio code analyzer shows errors in the TypeScript files for imports of modules which are declared in the definition files. If I add references like

/// <reference path="typings/tsd.d.ts" />

then errors are disappearing. But all these files are already declared in the tsconfig.json so I don't want to have two sources of these files. What is even more interesting that I have several modules (external) and I added reference comments only to one of them (the main one). If I reopen project and open some other TypeScript file (not main) - Visual Studio shows errors. If I open main TS file after that and wait a few seconds then errors disappear (in all TS files). And after each project reopen I need to open main TS file and wait few seconds.

Is it possible just to use files list with definitions from tsconfig.json without including reference comments?

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Nov 4, 2015

@oryol Please see this wikipage about using tsconfig.json and ASP.NET 5. https://github.com/Microsoft/TypeScript/wiki/Using-TypeScript-With-ASP.NET-5

I think the reason you're seeing what you're seeing is that we only check for tsconfig.json files in the scripts folder.

@oryol

This comment has been minimized.

Copy link

commented Nov 4, 2015

So, is it possible to use tsconfig.json in other folders (not in "Scripts")? If not - are you going to support such scenarios and when can we expect such feature?

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Nov 4, 2015

@oryol No, not in TypeScript 1.7 (or earlier). However I'm right now working on making the tsconfig.json support a lot better in VS 2015, you should see that in the 1.8 release.

Caveat: Any features don't actually exist until they're checked-in/shipped, and schedules can change at a moments notice.

@oryol

This comment has been minimized.

Copy link

commented Nov 4, 2015

Thank you for reply!

@defyjoy

This comment has been minimized.

Copy link

commented Mar 6, 2016

Does this still work for *.csproj files ? I opened a new blank asp.net application and tried to make it work with tsconfig.json .The project I chose in 2015 was

image

But it seems the VS completely ignores the tsconfig.json.

image

My project structure somewhat looks like this

image

Note : I am using typescript v1.8.2

@mhegazy

This comment has been minimized.

Copy link

commented Mar 7, 2016

@defyjoy can you try the latest (https://github.com/Microsoft/TypeScript/releases/tag/v1.8.7), and if you run into issues, please file a new issue and provide a project we can look at.

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2016

@defyjoy Can you make sure TypeScript shows in Help > About

@dehghani-mehdi

This comment has been minimized.

Copy link

commented Jan 18, 2017

Doesn't work here, I'm using VS 2015.3 and latest version of TypeScript

@dazinator

This comment has been minimized.

Copy link

commented Jan 18, 2017

When using VS2015, put the tsconfig file in a "Scripts" folder. Otherwise I don't think VS will find it or honour it.

@dehghani-mehdi

This comment has been minimized.

Copy link

commented Jan 18, 2017

@dazinator that isn't really good way to deal with config file, I always rename Script folder to js, personally prefer to use commad-line to deal with this issue.

@dazinator

This comment has been minimized.

Copy link

commented Jan 18, 2017

@dehghani-mehdi - yep I know. I also think it's a poor, but that is how the VS project system (vs2015) supports typescript projects as far as I know. This should help @defyjoy. If you want to handle typescript project compilation outside VS using tsc that will of course work.

@dazinator

This comment has been minimized.

Copy link

commented Jan 18, 2017

Also - if you do decide to use command line tsc to handle typescript project compilation, then you will want to disable VS from automatically transpiling ts files to js files (as it will to do that depending on your VS configuration settings for typescript language). To prevent VS from doing this in VS2015, add the following to your .csproj file:

<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
@dehghani-mehdi

This comment has been minimized.

Copy link

commented Jan 19, 2017

@dazinator Thanks for the note, for now I just add tsconfig.json to the project for disabling auto generate JS file by VS :), of course the correct solution is what you mentioned.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.