Problem:
When debugging in visual studio 2017, you can get this error:
Solution:
This is a bug in visual studio 2017.
You can't try to change your code to fix this.
Javascript debugging is a new feature and there are plenty of different options to debug javascript (Eg: use firefox or chrome console to debug js), so you can simply disable it
To disable Javascript debugging on visual studio 2017:
Vs > Debug menu item > Debugging > General > and uncheck 'Enable JavaScript debugging for ASP.NET (Chrome and IE)'.
Note: alternatively, you can try restarting your computer/windows.
For more information, see here.