Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PdfViewer example throwing null reference exception in js #662

Open
mark-fay-03 opened this issue Apr 16, 2024 · 4 comments
Open

PdfViewer example throwing null reference exception in js #662

mark-fay-03 opened this issue Apr 16, 2024 · 4 comments

Comments

@mark-fay-03
Copy link

PdfViewer example throwing null reference exception in js

I have followed the Blazor Bootstrap Getting Started guide to install Blazor Bootstrap on a .NET 8 Blazor (SSR) application. I then followed the example from the PdfViewer Component on the home.razor page for both the pdf from GitHub and the hard coded pdf byte stream.

I expected the pdf to load correctly.

Unfortunately, the PdfViewer loads then the blazor.js throws the exception below (after turning on DetailedErrors in appsettings.json) before displaying the PDF's contents.

[2024-04-16T20:12:58.956Z] Error: System.AggregateException: One or more errors occurred. (TypeError: Cannot read properties of null (reading 'insertBefore')) ---> System.InvalidOperationException: TypeError: Cannot read properties of null (reading 'insertBefore') at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents) --- End of inner exception stack trace ---

####Versions (please complete the following information):

  • BlazorBootstrap: 2.2.0
  • Blazor WebAssembly / Server: Server
  • .NET Version: .NET 8.0

####Sample code
Same as
https://docs.blazorbootstrap.com/getting-started/blazor-webapp-server-global-net-8#sample-code
https://docs.blazorbootstrap.com/components/pdf-viewer#base64string

@mark-fay-03
Copy link
Author

This also occurs with the starter template (NET8.BlazorWebAppRenderModeServerGlobal) provided in the documentation here.
https://github.com/vikramlearning/blazorbootstrap-starter-templates

@gvreddy04
Copy link
Contributor

@mark-fay-03 Thank you for reporting this. We will investigate.

@gvreddy04
Copy link
Contributor

@mark-fay-03 I am unable to reproduce the issue in the starter template.

Screenshot:

image

@gvreddy04
Copy link
Contributor

@mark-fay-03 Could you please provide a code sample or a link to a GitHub repository that demonstrates the issue with minimal steps for replication?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants