BlazorGoogleMaps icon indicating copy to clipboard operation
BlazorGoogleMaps copied to clipboard

Unhandled exception on some iOS devices

Open Nickztar opened this issue 2 years ago • 3 comments

Some of our users are currently experiencing a issue where they cannot load the map. It seems to only be sometimes and its fixed after restarting the phone. Anyone know what the issue is?

The device in this case was a iPhone 13 running iOS 15.3.1

Unhandled exception rendering component: undefined is not an object (evaluating 'fn[arr[i]]')
stringToFunction@https://SITE.com/_content/BlazorGoogleMaps/js/objectManager.js:6:16
createObject@https://SITE.com/_content/BlazorGoogleMaps/js/objectManager.js:294:43
createObject@[native code]
@https://SITE.com/_framework/blazor.webassembly.js:1:3337
Promise@[native code]
beginInvokeJSFromDotNet@https://SITE.com/_framework/blazor.webassembly.js:1:3317
Rt@https://SITE.com/_framework/blazor.webassembly.js:1:59761
_mono_wasm_invoke_js_blazor@https://SITE.com/_framework/dotnet.6.0.4.cm31jmhl2g.js:1:195318

Nickztar avatar May 19 '22 08:05 Nickztar

Maybe you have link to website/solution?

valentasm1 avatar May 19 '22 09:05 valentasm1

Well I can't really reproduce it, even with a similar device. It's probably not anything with this library to do but just wondering if anyone has experienced the same thing. It's caused when rendering the GoogleMap component. Which in turn passes google.maps.Map to the StringToFunction method.

Nickztar avatar May 19 '22 11:05 Nickztar

Not sure how to help. As far as i remember there was nothing related to ios. Probably it is some safari rendering issues. Lets leave open and maybe one day some great ideas will come to mind :).

valentasm1 avatar May 19 '22 12:05 valentasm1

Turn out this has to do with the Google Maps api not loading in time. They now require that you pass a callback function to loading the API. Not sure how we could handle this in the library but I will look into this soon.

Here are some links from their documentation. https://developers.google.com/maps/documentation/javascript/url-params#required_parameters https://developers.google.com/maps/documentation/javascript/overview#Inline

Nickztar avatar Jan 19 '23 10:01 Nickztar

We have similar principle. Map OnAfterInit is trigered when map is rendered. Just not sure if functionality is same as callback

valentasm1 avatar Jan 19 '23 10:01 valentasm1

Closing due inactivity. Feel free to open.

valentasm1 avatar Aug 29 '23 18:08 valentasm1

Yes that is fine! I do know what the issue is and somewhat have a fix for it. Might implement it if I get some time in the future 😃

Nickztar avatar Aug 29 '23 21:08 Nickztar