0

When support of interables in Array.From() function will be available?

GoogleMaps API will stop support of web apps that uses libs without it in April 2024.

3.54 version release notes:

The map is disabled when Array.from is overridden with an implementation that does not support iterables.

What can we do to go on using jQuery?

I have updated our web app to use jQuery 3.7.1 but it didn't solve the problem. I receive

Uncaught TypeError: this.Wg is not iterable

when using Google API 3.54 an higher.

10
  • So what IS Wg? And why not stop using jQuery or write a replacement fn or just use Array.from instead? Commented Mar 5, 2024 at 11:30
  • Please provide a minimal reproducible example so we can see this issue ourselves. Commented Mar 5, 2024 at 11:38
  • Wg is obfuscated variable/function from jQuery... Commented Mar 5, 2024 at 11:48
  • just use jQuery 3.7.1 and Google Maps API v.3.54 - they are not compatible because of this issue Commented Mar 5, 2024 at 11:49
  • 1
    This is a similiar problem. I'm trying now to use solution from it... stackoverflow.com/questions/76955952/… Commented Mar 5, 2024 at 12:25

1 Answer 1

0

Solved after several day of code cutting. The problem was in two cases:

  1. Redifinition of String

    if (!String.prototype.endsWith) { Object.defineProperty(String.prototype, 'endsWith', { value: function(searchString, position) { var subjectString = this.toString(); if (position === undefined || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; } }); } if (!String.prototype.startsWith) { Object.defineProperty(String.prototype, 'startsWith', { enumerable: false, configurable: false, writable: false, value: function(searchString, position) { position = position || 0; return this.indexOf(searchString, position) === position; } }); }

  2. map in window space:

    window.Map = Map;

After removing these two parts of code GoogleMaps start wotking witn version higher tha 3.53.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.