简体   繁体   中英

Blazor WebAssembly app tries to load script from `/_vs/browserLink` but it doesn't exist there

My Blazor Web Assembly app in .NET 7 runs well when I use do.net run , but when I run it from Visual Studio, I get in the browser console:

The script from “https://localhost:5008/_vs/browserLink” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Uncaught SyntaxError: expected expression, got '<'

Of course, it is trying to load a js script from /_vs/browserLink but it doesn't exist. I do not have a reference to BrowserLink anywhere in my project, and I don't have the browserlink Nuget package either.

  1. Is Visual Studio injecting this automatically?
  2. How do I figure out why is it failing? How do I make it work or stop trying?
  3. BrowserLink is unrelated to Hot Reload, right? Do I even want to use BrowserLink?

This happens in both debugging and running without debugging, on Kestrel.

I upgraded to .NET 7.0.1 (.NET SDK 7.0.101) and no longer have the trouble. Not sure if it was really just a bug fix or if something else changed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM