1
votes

I have this asp.net (4.6.2) web application which compiles and runs fine on my local machine.

The project is in a Git repo in VSTS.

I want this site deployed to Azure web sites. So I make a Webapp and set the deployment option to my VSTS Git repo.

This will automatically trigger a deployment... which fails.. with this error:

All packages listed in packages.config are already installed. D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(335,13): error TS1110: Build: Type expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj] D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(338,11): error TS1109: Build: Expression expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj] D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(339,1): error TS1128: Build: Declaration or statement expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj] Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\FormBuilder\FormBuilder.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d3e9219d2f6f3b";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\" An error has occurred during web site deployment.

It looks to me like it's compiling my .d.ts files. Don't know why..VS2015 does not do that.

I tried to exclude this file in a tsconfig but that does not work.

How can I make this build succeed?

2
May or may not be related, but we're looking at a TypeScript issue hereDavid Ebbo
@DavidEbbo it is not a core project. Look at the file it trying to build, that's a typings file. Vs automatically skips that but azure does not. Locally the same msbuild command runs fine btw.Flores
If you have a sample repo that demonstrates the issue, you can open a new Kudu issue and we'll investigate.David Ebbo
@David, I have done this, and it also fails. See repo here: github.com/floreseken/DeployTest this is a simple asp.net template added knockout typings with nuget, reference typings in a simple ts class, and it fails. No idea how to create kudu issue? tnxFlores
Please open a Kudu issue. It'll be easier to work through it than using SO comments :)David Ebbo

2 Answers

0
votes

So the problem is that the Azure build machine is not equipped with typescript 2.0 (yet) and knockout.d.ts uses a 2.0 syntax for something. See the comments below the question.

GitHub issue here

-1
votes

You need to compile type script files before deploying to azure. In deploy.cmd file on azure you can add this code to Compile TypeScript right after the npm packages are installed.

echo Transpiling TypeScript in %DEPLOYMENT_TARGET%...call :ExecuteCmd node %DEPLOYMENT_TARGET%\node_modules\typescript\bin\tsc -p "%DEPLOYMENT_TARGET%"

You can find the deploy.cmd file on KUDU in site->deployments->tools section.