Skip to content

IJSRuntimeExtensions: Fix when pre-rendering#10142

Merged
ScarletKuro merged 2 commits intoMudBlazor:devfrom
ScarletKuro:jsruntime_fix
Oct 30, 2024
Merged

IJSRuntimeExtensions: Fix when pre-rendering#10142
ScarletKuro merged 2 commits intoMudBlazor:devfrom
ScarletKuro:jsruntime_fix

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented Oct 30, 2024

Description

Fixes: #10141

Regression from: #9997

Apparently, there are are two JSRuntime types that throw similar error:
UnsupportedJavaScriptRuntime during static SSR.
RemoteJSRuntime - during SSR pre-render.
In the #9997 I removed when it was just checking for word "prerending" in the exception message and went for checking the JS runtime type instead.
The IsJsInteropAvailable doesn't help here, as it happening not on a component level, but during pre-render the DI is disposing the whole container, the BrowserViewportService is part of it, and it invokes DisposeAsync that has a JS call, so there is nothing better than just ignore this errors.

How Has This Been Tested?

Manually + bUnit test

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Oct 30, 2024
@codecov
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.18%. Comparing base (d7d39c9) to head (2883e4e).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10142   +/-   ##
=======================================
  Coverage   91.18%   91.18%           
=======================================
  Files         411      411           
  Lines       12480    12481    +1     
  Branches     2431     2432    +1     
=======================================
+ Hits        11380    11381    +1     
  Misses        556      556           
  Partials      544      544           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro merged commit 313387d into MudBlazor:dev Oct 30, 2024
@ScarletKuro ScarletKuro deleted the jsruntime_fix branch October 30, 2024 16:32
versile2 pushed a commit to versile2/MudBlazor that referenced this pull request Oct 31, 2024
LLauter pushed a commit to cannellamedia/MudBlazor that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudBlazor v8.0.0-preview.3 - JavaScript interop calls cannot be issued at this time - MudBlazor.BrowserViewportService

1 participant