Skip to main content

ASP.NET Core and Angular 2: understanding the differences between “broken code” and “compatibility issues”

It’s been six months from the first release of my ASP.NET Core and Angular 2 book and I’m very happy about the positive comments & reviews it received worldwide: however, in this post I will mostly talk about the negative reviews collected by the book, trying to figure out the reasons why they were given and saying my point of view about them.

Let’s start by looking at the numbers:

Read More

Error TS2693 Build:’Map’ only refers to a type and other Typescript compilation errors – How to Fix

Within the past two weeks I received a lot of feedbacks from the readers who bought my ASP.NET Core and Angular 2 book for a rather nasty issue which is also affecting a lot of Typescript-based applications. This is hardly something new: Typescript is sadly full of compilation issues, expecially whithin Visual Studio 2015 and 2017. We already dealt with them a number of times in the past: TS5023TS2304 and even the “Compile on Save” feature, just to name a few.

However this one is different because it involves an internal issue within the DefinitelyTyped repository, which used by many developers to “normalize” the type definitions among different versions of Typescript, thus addressing the compilation errors themselves: in other words, more than a Typescript bug we’re dealing with an internal issue of a useful workaround.

Read More

Visual Studio 2015 – How to fix TypeScript TS2304 compilation errors (and other ES6 compiling/transpiling issues)

I recently had my hard time trying to setup an ASP.NET Core 1.0Angular2 RC1 Web Project with Visual Studio 2015 and make the embedded TypeScript compiler/transpiler accept it. These were the errors I was facing:

As far as I knew, the issue was indeed related to the recent upgrade I made switching Angular2 beta to Angular2 RC1. I managed to fix that, but it took a fair amount of time due to the lack of documentation almost anywhere. Since I feel like it can happen to other developers, I will share the workarounds I found hoping to help someone to waste less time than I had to.

Read More

Fixing TypeScript “Compile on Save” feature in Visual Studio 2015 ASP.NET 5 RC1

One day I’ll write an extensive post about TypeScript, the amazing JS superset developed by Microsoft in 2012 and now widely adopted by a bunch of good projects such as Angular 2, ngrx/store and SearchKit. If you stumbled upon this post you’re probably already using it and you’re fully aware of how it works. To put it in short terms:

  • You write your source code using TypeScript proprietary syntax.
  • Your code is compiled into plain JavaScript by a dedicated compiler (tsc) upon a trigger.
  • The trigger is raised upon each build or upon a file change, depending on your Visual Studio general and/or project-specific settings.

Needless to say, setting the compile trigger upon file change is something that will greatly benefit your development speed. In order to activate it, you basically have two options: modifying the Visual Studio general settings for non-project files, or alter your project-specific settings.

Read More

Close