RubbleFord
RubbleFord

Reputation: 7636

Typescript build error (TS5007)

I've been trying to get typescript building via the build servers on visualstudio.com, and I've done the normal thing of bringing typescript into source control. But I'm getting the following issue:

VSTSC : error TS5007: Build: Cannot resolvereferenced file: 'COMPUTE_PATHS_ONLY'. [C:\a\src\Main\RecruitCloud\RecruitCloud.csproj]

I'm aware of the encoding issues, but in all the examples I've seen the culprit file has been named in the error message.

I'm starting to think this could be down to the number of typescript files I'm compiling in the project.

Any ideas?

Upvotes: 4

Views: 3392

Answers (2)

Hans Passant
Hans Passant

Reputation: 941744

This is a configuration option for the VsTsc task, the one that runs the compiler. It is used in the PreComputeCompileTypeScript target. The intention is to make the VsTsc task go through all the motions, except to run the compiler. That didn't pan out on your machine, it actually did run the compiler. Which then threw a fit since it can't find a file named COMPUTE_PATHS_ONLY.

The VsTsc task is stored in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\TypeScript.Tasks.dll. Looking at the assembly with a decompiler:

protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
    if (this.Configurations.Contains("--sourcemap"))
    {
        this.generateSourceMaps = true;
    }
    else
    {
        this.generateSourceMaps = false;
    }
    if (this.Configurations.Contains("--declaration"))
    {
        this.generateDeclarations = true;
    }
    else
    {
        this.generateDeclarations = false;
    }
    this.GenerateOutputPaths();
    if (!responseFileCommands.Contains("COMPUTE_PATHS_ONLY"))
    {
        return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
    }
    return 0;
}

Note the !responseFileCommands.Contains() test to bypass the base.ExecuteTool() call.

All I can guess is that the method doesn't look like this on your machine. With the most likely cause that you have an outdated version of TypeScript.Tasks.dll. On my machine with VS2013 Update 4 installed it is dated Nov 11, 2014 with a size of 27816 bytes.

Upvotes: 6

basarat
basarat

Reputation: 275997

Your best bet would be to simply resave all the files in Unicode encoding. You can do it from a quick powershell script (Change files' encoding recursively on Windows?)

Get-ChildItem *.txt | ForEach-Object {
$content = $_ | Get-Content

Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force}

Upvotes: 0

Related Questions