Reputation: 3149
I am running an ASP.NET Core
app with Angular
in visual studio 2017. Unfortunately whenever I run the project, it shows the following message in the browser:
Cannot GET /
So few hours of googling (Sample Link), I tried the following, adding in the tsconfig.json file:
"lib": [ "es5", "es6", "es2017", "dom" ]
In my case, that was earlier as follows:
"lib": [ "es2017" ]
Though the project was built successfully, it had few errors as follows:
Severity Code Description Project File Line Suppression State
Error TS2583 (TS) Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\@angular\common\src\directives\ng_class.d.ts 48 Active
Severity Code Description Project File Line Suppression State
Error TS2583 (TS) Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\@angular\core\src\change_detection\differs\default_keyvalue_differ.d.ts 24 Active
Severity Code Description Project File Line Suppression State
Error TS2585 (TS) 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\rxjs\Observable.d.ts 58 Active
Anything that I missed here? Any idea would be highly appreciated.
Upvotes: 0
Views: 248
Reputation: 27
Based on your error, I would think that you have a routing issue in the MVC part of your app. You should endure that your default route is configured correctly.
The following article gives some useful guidance here.
https://knightcodes.com/angular2/2017/01/05/angular-2-routes-with-asp-net-mvc.html
Upvotes: 0
Reputation: 3243
From the error messages you are getting it seems most likely your default configuration for JavaScript
is es5
or any other below es2015
. Meaning you are trying to use es2015
features and your compiler is now allowing you to. Check your IDE configs and make sure your JavaScript
config is set to at least es2015
Upvotes: 1