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

Issue with logInit Undefined in MAUI Blazor App on API 28 but Works on API 34 #26902

Closed
faisalkkv opened this issue Jan 1, 2025 · 3 comments
Closed
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView s/triaged Issue has been reviewed

Comments

@faisalkkv
Copy link

I am experiencing an issue when debugging a MAUI Blazor application on an Android emulator/device with API 28. The application fails with the following error:

Microsoft.JSInterop.JSException: 'Could not find 'logInit' ('logInit' was undefined). Error: Could not find 'logInit' ('logInit' was undefined). at https://0.0.0.0/_framework/blazor.webview.js:1:540 at Array.forEach (<anonymous>) at l.findFunction (https://0.0.0.0/_framework/blazor.webview.js:1:508) at w (https://0.0.0.0/_framework/blazor.webview.js:1:5251) at https://0.0.0.0/_framework/blazor.webview.js:1:3044 at new Promise (<anonymous>) at g.beginInvokeJSFromDotNet (https://0.0.0.0/_framework/blazor.webview.js:1:3007) at External.__callback (https://0.0.0.0/_framework/blazor.webview.js:1:48308) at MessagePort.<anonymous> (<anonymous>:23:21)

The error does not occur when debugging the same application on an Android emulator/device with API 34.

Steps to Reproduce

  • Create a MAUI Blazor application.
  • Add a call to a JavaScript function (logInit) in the Blazor component or page.
  • Debug the application on an Android emulator/device with API 28.
  • Observe the JSException error.
  • Debug the same application on an Android emulator/device with API 34.
  • Observe that the error does not occur on API 34.

Expected Behavior
The logInit JavaScript function should be found and executed successfully on both API 28 and API 34.

Actual Behavior
The application fails on API 28 with a JSException indicating that logInit is undefined, but it works as expected on API 34.

@jfversluis jfversluis added area-blazor Blazor Hybrid / Desktop, BlazorWebView s/needs-repro Attach a solution or code which reproduces the issue labels Jan 1, 2025
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Jan 6, 2025
@javiercn
Copy link
Member

javiercn commented Jan 7, 2025

@faisalkkv thanks for contacting us.

Can you check the Chrome version on the emulator?

  • Launch the Google Chrome app on the emulator.
  • Tap on the three-dot menu button in the top-right corner.
  • Select "Settings" from the menu.
  • Tap on "About Chrome".
  • You'll see the Chrome version in the "Application version" section.

@javiercn javiercn added the s/needs-info Issue needs more info from the author label Jan 7, 2025
@dotnet-policy-service dotnet-policy-service bot removed the s/no-recent-activity Issue has had no recent activity label Jan 7, 2025
@faisalkkv
Copy link
Author

@javiercn
here is the chrome version
Image

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author s/needs-repro Attach a solution or code which reproduces the issue labels Jan 7, 2025
@javiercn
Copy link
Member

javiercn commented Jan 8, 2025

@faisalkkv thanks for the additional details.

Blazor requires a recent chrome version as per our support policy. The chrome version on that emulator is from September 2018.

You can update the version of chrome in the emulator and then it should work.

@javiercn javiercn added s/triaged Issue has been reviewed and removed s/needs-attention Issue has more information and needs another look labels Jan 8, 2025
@javiercn javiercn closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView s/triaged Issue has been reviewed
Projects
None yet
Development

No branches or pull requests

3 participants