For me, I was seeing this error message in VS2022 because I had enabled JavaScript debugging when a dialog box ask me. Then, I did not know how to turn it off.
To toggle JavaScript debugging, go to Tools > Options > Debugging and toggle the checkbox for Enable JavaScript debugging for ASP.NET (Chrome, Edge, and IE):