Appharbor only supports TypeScript 1.5?
Does AppHarbor only support TypeScript 1.5?
If so, when will TypeScript be supporting newer versions? Visual Studio 2015 does not support 1.5:
Your project file uses an older version of the TypeScript compiler and tools than supported by this version of Visual Studio. Your project may be using TypeScript language features that will result in errors when compiling with this version of the TypeScript tools. To remove this warning, remove the element from your project file
AppHarbor was failing my build with TypeScript 1.6:
2>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\Microsoft.TypeScript.targets(87,5): error : Your project file uses a different version of the TypeScript compiler and tools than is currently installed on this machine. No compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.6\tsc.exe. You may be able to fix this problem by changing the <TypeScriptToolsVersion> element in your project file. [D:\temp\cfsu3tj0.yd5\input\BlogWeb.csproj]
2>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\Microsoft.TypeScript.targets(87,5): error MSB6004: The specified task executable location "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.6\tsc.exe" is invalid. [D:\temp\cfsu3tj0.yd5\input\BlogWeb.csproj]
2>Done Building Project "D:\temp\cfsu3tj0.yd5\input\BlogWeb.csproj" (default targets) -- FAILED.
1>Done Building Project "D:\temp\cfsu3tj0.yd5\input\AppHarbor.sln" (default targets) -- FAILED.
Build FAILED.
I resolved this by changing my CSPROJ file to <TypeScriptToolsVersion>1.5</TypeScriptToolsVersion>
Discussions are closed to public comments.
If you need help with AppHarbor please
start a new discussion.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by rune on 20 Apr, 2016 08:13 AM
Hi,
Yep, currently only TypeScript versions up to 1.5 are installed on the build servers -- more recent versions can likely be installed shortly, but I think there's a better and more elegant solution to this issue -- since TypeScript version 1.8 the TypeScript team has been providing official NuGet packages. This means you can simply install those packages and let AppHarbor restore them prior to building your project. This way you loose the dependency on the build environment you use, and the compiler version will be exactly the same locally and on AppHarbor.
If you'd like to try this you'll just need to installed the Microsoft.TypeScript.Compiler and Microsoft.TypeScript.MSBuild packages -- make sure to commit the changes to your project files and
packages.configfiles (the actual packages in thepackagesfolder can be omitted as they'll be restored prior to the build.Best,
Rune
2 Posted by jhoppe on 29 Apr, 2016 02:27 PM
I converted my HoppeUAT application to a vs2015 html app with TypeScript, and added these two packages.
Should it work with html apps with ts? AppHarbor isn't transpiling the TypeScript files to JavaScript. I.e., if I download the build, there is no app\mocks.js.
Here is my tsconfig:
{
"compilerOptions": {
"module": "amd",
"rootDir": "src",
"sourceMap": true,
"target": "es5"
},
"compileOnSave": true,
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts",
"typings2"
]
}
Here is my packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.TypeScript.Compiler" version="1.8.11" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.TypeScript.MSBuild" version="1.8.11" targetFramework="net461" developmentDependency="true" />
</packages>
Build: c6801576
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.45
Support Staff 3 Posted by rune on 03 May, 2016 02:04 AM
Hi,
There could be a couple of reasons why the build output doesn't contain the transpiled javascript files. Perhaps the transpiling is occuring in the input folder (i.e. instead of the output folder that is used when deploying the app), or there isn't a task in your project file which automates and runs typescript against it.
I suspect this is related to the later issue as the most recent build doesn't seem to have any typescript related tasks judging from the logs. I'd assume that this is something it makes sense to run as a post build event of sorts -- do you have something like that configured already? Otherwise, how do you transpile the typescript files to javascript when you're running your application locally?
Best,
Rune
Support Staff 4 Posted by rune on 03 May, 2016 02:50 AM
Hi again,
I went ahead and tried this myself and didn't experience any issues with TypeScript compilation after installing the NuGet packages. It sounds like you've already installed both packages, so I think the issue is related to a missing MsBuild task in the web project file.
The task is added automatically when you install the package. However the file sometimes needs to be saved before it shows up in Git and can be committed. Perhaps that's what is missing here? Take a look at this commit to see the tasks added when installing the MsBuild task package.
I also tried applying the relevant settings from your
tsconfig.jsonfile and this didn't affect the result either, so I'm fairly certain the absence of the relevant task in your project file is the reason it's not being compiled as expected.This sample project is just a basic template VS2015 HTML app with TypeScript. The commits show installation of each of the packages, adding a
tsconfig.jsonfile and updating the compiler settings to match yours -- might be helpful to use/check this out while debugging this issue.I hope this helps and let me know how it works out for you!
Best,
Rune
5 Posted by jhoppe on 06 May, 2016 06:26 PM
Hi Rune,
I confirmed that your commit (csproj, packages.config) are both in my project. Do you have access to my codebase? A second pair of eyes would definitely be appreciated.
I am targeting .NET 4.6.1 - shouldn't make a difference, right? I am a bit stumped!
Thanks,
Joe
6 Posted by jhoppe on 06 May, 2016 07:36 PM
Hi Rune,
I created a new app HoppePOC and started with your code as a baseline. TypeScript works as you suggested. I've been copying my changes into the project and comparing the project settings, and that site seems to be working fine.
Do you see any difference between the two?
I'm wondering if this is something on the AppHarbor end...?
This is just my UAT site... Anything you can do on your end, like wipe the workspace, or start a rebuild? It is my UAT site, so I am OK with outages.
Thanks,
Joe
7 Posted by jhoppe on 06 May, 2016 08:21 PM
I compared the build logs and my site is missing the steps 'PreComputeCompileTypeScriptWithTSConfig' and 'CompileTypeScriptWithTSConfig'. Any idea how I can get them to kick off?
2>PrepareForBuild:
Creating directory "obj\Release\".
PreComputeCompileTypeScriptWithTSConfig:
D:\temp\uzxdac4l.zvr\input\packages\Microsoft.TypeScript.MSBuild.1.8.11\tools\tsc\tsc.exe --project "D:\temp\uzxdac4l.zvr\input\TsSampleApp\tsconfig.json"
CompileTypeScriptWithTSConfig:
D:\temp\uzxdac4l.zvr\input\packages\Microsoft.TypeScript.MSBuild.1.8.11\tools\tsc\tsc.exe --project "D:\temp\uzxdac4l.zvr\input\TsSampleApp\tsconfig.json"
CoreCompile:
Support Staff 8 Posted by rune on 06 May, 2016 10:45 PM
Hi,
I think the issue is that the build targets added by the MsBuild package doesn't exist in the location referenced by your project file. For instance, from the NuGet restore logs it seems that the packages are restored in the root input directory (
D:\temp\3ct3wirf.hnc\input\packages), which is also where both the solution and project files are located. However, the references in your project files point to a different location (..\packages\Microsoft.TypeScript.MSBuild.1.8.11).I suspect the reason you're hitting this issue is because the solution/project layout is a bit unusual. Usually when creating a new solution Visual Studio will create the solution file in the root directory and projects in a nested directory. NuGet relies on this in the sense that the
packagesfolder is usually in the same directory as the solution so multiple projects can share the same restored packages.You might want to either nest the project file in a separate folder below the solution file, or just updated the project references in your project file.
Best,
Rune
9 Posted by jhoppe on 09 May, 2016 12:46 PM
Rune,
For development, I use a different solution file (not appharbor.sln). Because I used to have multiple web projects in the solution, I created appharbor.sln so that I could have a single web project, so that appharbor knew which to deploy. Since this solution was used solely for Blog.FrontEnd.sln, I put the solution file in that folder.
As per your recommendation, I moved appharbor.sln up a folder, next to my other solution file. It seems to have resolved the issue.
Thank you - great learning experience!
Joe
Support Staff 10 Posted by rune on 09 May, 2016 10:10 PM
Hi Joe,
OK great, glad it worked out and thanks for the follow-up! Let me know if there's anything else I can help with.
Best,
Rune
rune closed this discussion on 09 May, 2016 10:10 PM.