Typescript: Visual Studio 2015.2 Integration: Publish Fails with tsconfig.json

Created on 20 May 2016  路  4Comments  路  Source: microsoft/TypeScript

TypeScript Version:

1.8.31.0

Visual Studio Version:

VS 2015 Enterprise
14.0.25.123.00 Update 2

Description:
The scenario is as follows: A simple Visual Studio web project with a tsconfig.json file and two TypeScript source files: foo.ts and fooBar.ts. tsconfig.json is configured to compile all .ts artifacts into a single app.js file (using compilerOptions.outFile). When trying to publish the project, the following error is reported: "Copying file foo.js to obj\Release\Package\PackageTmpfoo.js failed. Could not find file 'foo.js'."

I guess the publish process looks for a matching .js file for each .ts file and is not able to follow the tsconfig.json settings.

Full Repro available: https://github.com/olohmann/VisualStudioTypeScriptPublishIssue

Expected behavior:
Publish works as expected.

Actual behavior:
Publish fails.

Bug Fixed

Most helpful comment

As an FYI - The other problems I mentioned were not fixed by updating the MyGet. Be prepared to get a lot of errors after updating because the updated compiler creates readonly flags for your getters. You can edit the tsc.js file under /packages/[typescript 1.9 beta msbuild verson]/tools/tsc. Just search for "readonly" in the document and find the last reference where it says something to the effect of "if(flags & 64)". Comment out that whole if block and it won't write out the "readonly" modifier and you won't get all of the erroneous messages in your error list.

All 4 comments

We had the same issue. There was another issue opened on this (don't recall where or I'd link it). It's been fixed on the 1.9 prerelease on MyGet. We were using the May 9th build which had the issue fixed but resulted in a massive number of "Errors" that showed up after a successful build when Build + Intellisense was enabled in the error window. Today we updated the package to the latest prerelease (May 20th) build and those errors are gone as well and everything is working smoothly.

If this isn't something mission critical I'd suggest trying the Typescript preview builds for 1.9 on MyGet.
https://www.myget.org/gallery/typescript-preview

@paulvanbrenk can you take a look.

Yes, this is fixed in the MyGet package referenced by @dustinhorne and will be in the official 2.0 release.

As an FYI - The other problems I mentioned were not fixed by updating the MyGet. Be prepared to get a lot of errors after updating because the updated compiler creates readonly flags for your getters. You can edit the tsc.js file under /packages/[typescript 1.9 beta msbuild verson]/tools/tsc. Just search for "readonly" in the document and find the last reference where it says something to the effect of "if(flags & 64)". Comment out that whole if block and it won't write out the "readonly" modifier and you won't get all of the erroneous messages in your error list.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartynasZilinskas picture MartynasZilinskas  路  3Comments

jbondc picture jbondc  路  3Comments

uber5001 picture uber5001  路  3Comments

Zlatkovsky picture Zlatkovsky  路  3Comments

bgrieder picture bgrieder  路  3Comments