After discovering the ASPNETCoreTemplatePack by MadsKristensen, I was excited to use it as a foundation for developing ASP.NET Core applications with Angular 2. However, upon delving into editing, I encountered a whopping 448 errors in the error-list dialog. These errors stemmed from TypeScript files, some from example Angular components and others from node.js modules. The column labeled "project" indicated they were part of a "virtual TypeScript project," prompting me to open them randomly.
An illustration:
No. 1:
ClientApp/app/components/app/counter/counter.component.ts
@Component({
selector: 'counter',
template: require('./counter.component.html')
})
Visual Studio flagged an issue stating "The name "require" was not found."
No. 2:
node_modules/rxjs/add/operator/map.d.ts
import { MapSignature } from '../../operator/map';
declare module '../../Observable' {
interface Observable<T> {
map: MapSignature<T>;
}
}
Error message: "Invalid module name in augmentation, module '../../Observable' cannot be found."
This trend continued across nearly 500 errors. Despite these issues, the app compiled successfully, functioning as expected. For instance, the counter-component, which initially failed due to the error, functioned well after the require-function loaded its view. My concern now is that these errors are distracting me from identifying genuine mistakes within my code, which need attention.
Attempts made so far:
- Configuring
TypeScriptCompileBlocked
to true in the project file, following instructions outlined here: - Including a
tsconfig.json
in the project-root with"exclude": [ "bin", "node_modules" ]