JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

project failed to run when Visual Studio 2015 publish project to bin\Release\PublishedOutput

Open nklt opened this issue 10 years ago • 2 comments

All sample applications as well as SPA template failed to compile and run, once Visual Studio builds and publish the application to bin\Release\PublishedOutput location within the project space.

This cause the Visual Studio .net core compile, and as well as dotnet tools, to give an erroneous error on typescript file.

Duplicate identifier 'export='.

This error appeared in all typescript source file, such the require.d.ts and tsd.d.ts in Angular2SPA template.

Once the PublishedOutput is removed, the error disappear.

nklt avatar Aug 26 '16 17:08 nklt

Thanks for reporting this.

TypeScript doesn't like it if it can see duplicate copies of definitions. You can solve this problem by adding bin to the list of excluded directories in tsconfig.json.

I've just applied this fix to the source, i.e.: https://github.com/aspnet/JavaScriptServices/commit/09e1cd3b077aa505be73fdcd2f87658510e8cc34

SteveSandersonMS avatar Sep 01 '16 13:09 SteveSandersonMS

Adding excluded bin directory fixed the first error, but introduced the next error in Typescript.

Severity Code Description Project File Line Suppression State Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects C:\workspace6\Angular2Spa\node_modules\rxjs\add\observable\combineLatest.d.ts 2 Active

This error is seen on every typescript file in the project.

It appear the TSC cannot comletely ignore the bin folder for some reason.

nklt avatar Sep 01 '16 22:09 nklt