You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When running the app in Visual Studio in Windows Machine, the GUI controls show, but the pdf area is blank. When checking developer tools with ctrl+shift+i javascript errors appear reported in the console:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec.
pdfjs-4.0.379.worker.min.mjs:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec.
blazor.webview.js:1
Failed to fetch dynamically imported module: https://0.0.0.0/_content/Blazor.Bootstrap/blazor.bootstrap.pdf.js
TypeError: Failed to fetch dynamically imported module: https://0.0.0.0/_content/Blazor.Bootstrap/blazor.bootstrap.pdf.js
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at BlazorBootstrap.PdfViewerJsInterop.InitializeAsync(Object objRef, String elementId, Double scale, Double rotation, String url)
at BlazorBootstrap.PdfViewer.b__11_0()
at BlazorBootstrap.BlazorBootstrapComponentBase.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
NotifyUnhandledException @ blazor.webview.js:1
I've been experiencing the same error for two days, trying to fix it until the idea of checking the reported issues came to mind. Thank you for posting this issue
Normally, The problem is in this js file _content/Blazor.Bootstrap/blazor.bootstrap.pdf.js and especially when importing those two lines:
import * as pdfJS from './pdfjs-4.0.379.min.mjs';
import * as pdfWorker from './pdfjs-4.0.379.worker.min.mjs';
Description
When running the app in Visual Studio in Windows Machine, the GUI controls show, but the pdf area is blank. When checking developer tools with ctrl+shift+i javascript errors appear reported in the console:
How to reproduce
<PdfViewer Url="some.pdf" />
Expected behavior
The PDF is visualized.
Screenshots
Versions
Desktop:
The text was updated successfully, but these errors were encountered: