vikramlearning / blazorbootstrap

An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
https://docs.blazorbootstrap.com/
Apache License 2.0
734 stars 38 forks source link

PDF Viewer example doesn't works on Blazor wasm #857

Closed RenatoRolando closed 2 months ago

RenatoRolando commented 2 months ago

Describe the bug

To Reproduce

  1. Setup a new WASM Blazor app as on instruction on [(https://docs.blazorbootstrap.com/getting-started/blazor-webassembly-net-8)]
  2. Copy PDF viewer example [(https://demos.blazorbootstrap.com/pdf-viewer)] on new Blazor WASM page.
  3. Run it on debug.
  4. You will receive: Error: Could not find 'window.blazorBootstrap.tooltip.initialize' ('blazorBootstrap' was undefined).

Expected behavior Show the pdf

Versions (please complete the following information):

Additional context Using Visual Studio : 17.11.1

Seems it's probably missing Popper library for popup (I used it on Net.ASP Bootstrap 5).

If correct please how to add it on blazorbootstrap ?

Thanks Renato

gvreddy04 commented 2 months ago

@RenatoRolando Thank you for trying BlazorBootstrap. Please share a sample GitHub repor to reproduce the issue with minimal steps.

NOTE: Please do not share sensitive information.

RenatoRolando commented 2 months ago

@gvreddy04 Thank you for fast replay. I done from scratch... and it works! I have to understand what happen on my project that damage the viewer. If I will found in this day I will notify to you. Otherwise I will rebuild my app from scratch.

RenatoRolando commented 2 months ago

I found the problem, was a call to a service (json reader) just before without rty{}...catch() !

https://demos.blazorbootstrap.com/pdf-viewer#base64-string

    protected override void OnInitialized()
    {
        //Added this line that makes crashes
        var settings = await _appSettingsService.GetSettingsAsync();

        // get pdf as base64 string
       pdfBase64String = @"...";
    }

thanks and sorry for this post ;)