Too Many Erorrs With Google Directions Component

Wappler Version : 3.9.9
Operating System : W10
Server Model: NodeJS

Actual behavior

I have added Google Directions component on my page, and it is calculating the routes dynamically as inputs changes. This is all working great, but the console is full or errors when no route is found.
This happens in two cases:

  1. On page load, when there are no values in the dynamic binding for origin & destination.
  2. After search, when there is actually no route between selected origin & destination addresses.

How to reproduce

Just add a Google Direction component & two Google Places Autocompletes. Bind origin & destination dynamically in Direction and see the error in console when the page loads.

A suggestion for the solution would be to not throw any of these (utc_offset, no results, zero_results etc) errors on the console and instead expose a dynamic event for ZERO_RESULT response.
Also, some handling in core code to not run this API when routes inputs are empty.

Have here an update for google places to fix the offset error:

dmxGooglePlaces.zip (1.8 KB)

and an update for direction to not display warning in console and it will trigger an emptyresults event:

dmxGoogleDirections.zip (2.2 KB)

Thank you for the quick response. I wasn’t expecting a fix so soon given you guys are busy with 4.0 release.

Google Places offset issue has been fixed with the shared file. :+1:

Directions is still throwing the Uncaught (in promise) error & the message “Direction request returned no results.”
I did not understand how would I use the empty results event. Don’t see it in the dynamic events UI.

See if the following fixes the Uncaught error.

dmxGoogleDirections.zip (2.2 KB)

The new event can be used like dmx-on:noresults="", it is only available in code for now since I just added it, we will add it to the UI with an Wappler update.

Still seeing it in console. :frowning:

noresults event does work though. :slight_smile:

What is in the stacktrace of the Uncaught error?

This is all I could get. The link transfer:1 does not navigate.
I have shared the link to my page privately. You can see the error as soon as the page loads.

I don’t think I can remove the Uncaught error message, this is something in the code from google.

Here an other small update, some optimizations and added an extra error event for when the request fails (error which is not zero results).

dmxGoogleDirections.zip (2.2 KB)

Fixed in Wappler 4 beta 8

This topic was automatically closed after 45 hours. New replies are no longer allowed.