Upgrading to 18.3.0.41 causing webassembly crash on File uploader control that was working in 18.2 version

Upgrading to 18.3.0.41 causing webassembly crash on File uploader control that was working in 18.2 version.

While upgrading to 18.3 version, to get a fix to a bug with another control (SfDialog), I have run across a crash in with the file uploader (SfUploader).
As stated this code was working in 18.2 version so now I am stuck


The control is defined as:

<SfUploader ID="UploadFiles"
                                Multiple="false"
                                MaxFileSize=104857600>
                        <UploaderEvents ValueChange="OnChange"
                                        BeforeUpload="OnBeforeUpload"
                                        Success="OnSuccessfulUpload">
                        </UploaderEvents>
                    </SfUploader>


The exception is:

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not find 'import' in 'window.sfBlazor'.
      Error: Could not find 'import' in 'window.sfBlazor'.
          at https://localhost:44316/_framework/blazor.webassembly.js:1:9130
          at Array.forEach (<anonymous>)
          at p (https://localhost:44316/_framework/blazor.webassembly.js:1:9090)
          at https://localhost:44316/_framework/blazor.webassembly.js:1:9800
          at new Promise (<anonymous>)
          at Object.beginInvokeJSFromDotNet (https://localhost:44316/_framework/blazor.webassembly.js:1:9773)
          at _mono_wasm_invoke_js_marshalled (https://localhost:44316/_framework/wasm/dotnet.3.2.0.js:1:171294)
          at do_icall (<anonymous>:wasm-function[6049]:0x10f8b1)
          at do_icall_wrapper (<anonymous>:wasm-function[1896]:0x50b6a)
          at interp_exec_method (<anonymous>:wasm-function[1120]:0x2588e)
Microsoft.JSInterop.JSException: Could not find 'import' in 'window.sfBlazor'.
Error: Could not find 'import' in 'window.sfBlazor'.
    at https://localhost:44316/_framework/blazor.webassembly.js:1:9130
    at Array.forEach (<anonymous>)
    at p (https://localhost:44316/_framework/blazor.webassembly.js:1:9090)
    at https://localhost:44316/_framework/blazor.webassembly.js:1:9800
    at new Promise (<anonymous>)
    at Object.beginInvokeJSFromDotNet (https://localhost:44316/_framework/blazor.webassembly.js:1:9773)
    at _mono_wasm_invoke_js_marshalled (https://localhost:44316/_framework/wasm/dotnet.3.2.0.js:1:171294)
    at do_icall (<anonymous>:wasm-function[6049]:0x10f8b1)
    at do_icall_wrapper (<anonymous>:wasm-function[1896]:0x50b6a)
    at interp_exec_method (<anonymous>:wasm-function[1120]:0x2588e)
  at System.Threading.Tasks.ValueTask`1[TResult].get_Result () <0x42623c0 + 0x00034> in <filename unknown>:0 
  at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync (Microsoft.JSInterop.IJSRuntime jsRuntime, System.String identifier, System.Object[] args) <0x425fe08 + 0x000e4> in <filename unknown>:0 
  at Syncfusion.Blazor.Internal.SfBaseUtils.ImportScripts (Microsoft.JSInterop.IJSRuntime jsRuntime, System.String modulePath) <0x425f4d0 + 0x000d4> in <filename unknown>:0 
  at Syncfusion.Blazor.Internal.SfBaseUtils.ImportModules (Microsoft.JSInterop.IJSRuntime jsRuntime, System.Collections.Generic.List`1[T] scriptModules, System.String hashKey) <0x40dfae8 + 0x0017c> in <filename unknown>:0 
  at Syncfusion.Blazor.BaseComponent.InitComponent () <0x420b578 + 0x002f2> in <filename unknown>:0 
  at Syncfusion.Blazor.Internal.ResourceManager.OnAfterRenderAsync (System.Boolean firstRender) <0x41230c0 + 0x0028a> in <filename unknown>:0 
  at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle) <0x420d5b8 + 0x000b6> in <filename unknown>:0 
  

3 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team October 19, 2020 07:01 AM UTC

Hi ScottAtScorpios, 

Thanks for contacting Syncfusion support. 

The cause for the script error “Could not find 'import' in 'window.sfBlazor” due to resources were not loaded properly also due to NuGet cache since the same piece of code working in our end. So we suggest you to clear the NuGet by following the below link.   


Also, we would like to let you know that, the static webassets will always be cached in the browser when we using Blazor WebAssembly application since the resources are loaded in the browser side for rendering.  So, we suggest you to set the HTTP header with no-cache option in your server configuration to resolve this problem. Please refer to the below Github thread and ASP.NET forum for more details.   
    
    

Please let us know if you need any further assistance on this. 

Regards, 
Ponmani M 


Marked as answer

SC ScottAtScorpios October 19, 2020 10:43 AM UTC

Thank you for your help.

The clearing of the nuget packages helped and the red squiggly lines in VS didn't show up 
but that appeared to be 1/2 the problem since it would still crash.
I set the browsers from Chrome to Edge and the program worked.
Next, I cleared the cache in chrome, switched back to chrome, and the program is working again.

So both suggestions were needed to correct my problem.

Thank you again.






PM Ponmani Murugaiyan Syncfusion Team October 20, 2020 06:25 AM UTC

Hi ScottAtScorpios, 

Thanks for the update. 

We are glad to hear that the provided suggestion helps you in achieving your requirement. Please get back us if you need further assistance. 

Regards, 
Ponmani M 


Loader.
Up arrow icon