Blazor WebAssembly Javascript isolation Error - Stack Overflow

admin2025-04-17  3

I am using Blazor Webassembly project.

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

Here is my code.

ObjectReference = await JSRuntime.InvokeAsync<IJSObjectReference>("import", "./js/GoogleMap.js");
 //await JsObjectReference.InvokeVoidAsync("loadScript", "=");


 await ObjectReference.InvokeVoidAsync("initGoogleMap", "GoogleMapDiv", BlazorPageRef, "GoogleMapErrorDiv", googleMApKey);
转载请注明原文地址:http://anycun.com/QandA/1744894288a89129.html