Status Update
Comments
rc...@google.com <rc...@google.com> #2
Thanks for the post.
Upon checking, it appears that this is a duplicate of
Thank you for your patience and contributions.
te...@gmail.com <te...@gmail.com> #3
Hmm, I don't know how I missed that old bug, I did do a search.
I'm not sure how long it will take me to get a minimal repro working, but I can say that it was really easy to spin up a repor as a minimal react project with the react-google-maps/api component. Doing absolutely nothing but mounting the map generates 16 of these warnings.
I'll see what I can do.
te...@gmail.com <te...@gmail.com> #4
I'm not sure how self contained this is, but I was able to instantiate the initMap
function: map.addListener("onClick", () => {return;});
, and it generates sixteen of these warnings:
20:33:29.243 Navigated to file:///C:/Users/Lucius%20Riccio/Documents/GitHub/react-google-maps-warning-bug/simple_repro/public/index.html
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:31.255 [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
20:33:29.766 util.js:43 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
(anonymous) @ util.js:43
_.GE @ util.js:128
Nga @ onion.js:37
(anonymous) @ onion.js:44
20:33:29.766 util.js:43 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
(anonymous) @ util.js:43
_.GE @ util.js:128
Nga @ onion.js:37
(anonymous) @ onion.js:44
20:33:30.229 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
hO @ controls.js:132
_.n.Nn @ controls.js:193
(anonymous) @ map.js:99
20:33:30.233 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
JN @ controls.js:103
QN @ controls.js:110
ida @ controls.js:138
hO @ controls.js:134
_.n.Nn @ controls.js:193
(anonymous) @ map.js:99
20:33:30.235 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
(anonymous) @ util.js:175
_.xe @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:73
_.CJ @ util.js:175
NN @ controls.js:105
QN @ controls.js:110
ida @ controls.js:138
hO @ controls.js:134
_.n.Nn @ controls.js:193
(anonymous) @ map.js:99
20:33:30.237 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
TM @ controls.js:48
QN @ controls.js:111
ida @ controls.js:138
hO @ controls.js:134
_.n.Nn @ controls.js:193
(anonymous) @ map.js:99
20:33:30.238 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
gO @ controls.js:137
hO @ controls.js:134
_.n.Nn @ controls.js:193
(anonymous) @ map.js:99
20:33:30.259 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
CN @ controls.js:100
FN @ controls.js:98
GN @ controls.js:102
qda @ controls.js:144
fda @ controls.js:148
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.259 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
CN @ controls.js:100
FN @ controls.js:99
GN @ controls.js:102
qda @ controls.js:144
fda @ controls.js:148
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.271 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
xN @ controls.js:89
yN @ controls.js:92
sda @ controls.js:145
fda @ controls.js:148
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.272 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
xN @ controls.js:90
yN @ controls.js:92
sda @ controls.js:145
fda @ controls.js:148
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.272 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
xN @ controls.js:90
yN @ controls.js:92
sda @ controls.js:145
fda @ controls.js:148
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.276 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
fN @ controls.js:63
_.gN @ controls.js:67
Rca @ controls.js:81
oN @ controls.js:79
gda @ controls.js:142
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.276 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
fN @ controls.js:63
_.gN @ controls.js:67
Rca @ controls.js:81
oN @ controls.js:79
gda @ controls.js:142
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.281 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
_.ME @ util.js:132
fN @ controls.js:63
_.gN @ controls.js:67
Rca @ controls.js:81
oN @ controls.js:79
gda @ controls.js:142
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
20:33:30.281 util.js:26 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
_.TA @ util.js:26
fN @ controls.js:63
_.gN @ controls.js:67
Rca @ controls.js:81
oN @ controls.js:79
gda @ controls.js:142
(anonymous) @ controls.js:131
_.n.Hi @ js?key=AIzaSyAvf-00kEHOEuEs0pcOmEkGfNnpu_NNnDY&callback=initMap&libraries=&v=weekly:241
I'm attaching it without the node_modules. It shouldn't be needed, I generated these warnings after generating a production build in public. Try running it locally.
rc...@google.com <rc...@google.com> #5
Thank you for waiting.
Just to further clarify, one of the main reasons why we are asking for a self contained sample is also to make sure that the issue is with our Maps API, and not with the 3rd party react library that you are using. As we only support the API itself, and 3rd party frameworks/libraries are generally not part of our scope.
We will patiently wait for your response. Thank you!
rc...@google.com <rc...@google.com> #6
Hello,
It seems we have sent our comments only a few minutes apart. That said, thank you for providing that info, we will get back to you as soon as we can or if we need more info. Thank you!
rc...@google.com <rc...@google.com> #7
Thank you for patiently waiting for a response.
Upon inspection, we can see that you are actually using a 3rd party library
So as much as we would like to help you, the best we can do is to point you in this repository
te...@gmail.com <te...@gmail.com> #8
Fair enough. So, I went back and simplified it to only manually use the raw Google Maps Javascript API in a script tag in a minimal html document. It still reproduces, and triggers 16 passive event listener warnings. I'll attach, please reopen!
te...@gmail.com <te...@gmail.com> #9
Wait a second, it appears that I'm triggering the warning without even adding my own event listener!
rc...@google.com <rc...@google.com> #10
te...@gmail.com <te...@gmail.com> #11
Well this is certainly curious. If I
This is a funny heisenbug for sure. Now I have no clue why it would generate warnings on my machine but not yours. Let me investigate a bit further.
te...@gmail.com <te...@gmail.com> #12
I get the warnings in incognito mode too, so it's not something to do with extensions. There don't appear to be any chrome flags that might affect this either. My Chrome version string (as copied from about chrome) is: Version 90.0.4430.51 (Official Build) beta (64-bit)
. Are you trying to reproduce with a different version? Older or newer? Maybe because I'm on the beta channel? Are you looking at verbose messages in console too?
rc...@google.com <rc...@google.com> #13
Thank you for waiting.
We tested this on both Windows and Chrome OS with both of their browsers having version 89.0.4389.116 (Official Build) (64-bit). No such warnings was generated in both the JSfiddle and browser's console. Perhaps try it in a different device and see if that helps.
te...@gmail.com <te...@gmail.com> #14
Interesting. We seem to have a true heisenbug here. I will try to repro on other devices, and will update.
Would native stack traces help? I think I can quite easily drop into windbg and give you the exact code that's triggering it.
te...@gmail.com <te...@gmail.com> #15
It's a bit difficult to get a breakpoint on ReportBlockedEvent because it's in an anonymous namespace and is inlined, but it doesn't seem like I'm hitting it anyways. Perhaps that means something?
So the very top of the stack from where some of the warnings are seemingly being generated through ReportGenericViolation
is:
Breakpoint 6 hit
chrome!blink::PerformanceMonitor::ReportGenericViolation:
00007fff`02bf9a40 56 push rsi
0:000> kPa
# Child-SP RetAddr Call Site
00 00000027`cbdfd508 00007fff`05c1615a chrome!blink::PerformanceMonitor::ReportGenericViolation(
class blink::ExecutionContext * context = 0x0000277d`8cbfba40,
blink::PerformanceMonitor::Violation violation = kDiscouragedAPIUse (0n4),
class WTF::String * text = 0x00000027`cbdfd570
Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952,
class base::TimeDelta time = class base::TimeDelta,
class std::__1::unique_ptr<blink::SourceLocation,std::default_delete<blink::SourceLocation> > location = <Value unavailable error>) [c:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\core\frame\performance_monitor.cc @ 40]
01 00000027`cbdfd510 00007fff`05a35461 chrome!blink::EventTarget::SetDefaultAddEventListenerOptions(
class WTF::AtomicString * event_type = 0x00000027`cbdfd648
touchstart,
class blink::EventListener * event_listener = <Value unavailable error>,
class blink::AddEventListenerOptionsResolved * options = 0x00003ba3`82d30558)+0x23a [c:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\core\dom\events\event_target.cc @ 439]
02 (Inline Function) --------`-------- chrome!blink::EventListenerOptions::setCapture(
bool value = <Value unavailable error>)+0x19 [c:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\blink\renderer\core\dom\events\event_listener_options.h @ 50]
03 (Inline Function) --------`-------- chrome!blink::EventTarget::addEventListener(
class WTF::AtomicString * event_type = <Value unavailable error>,
class blink::EventListener * listener = <Value unavailable error>,
bool use_capture = <Value unavailable error>)+0x54 [c:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\core\dom\events\event_target.cc @ 482]
04 00000027`cbdfd5c0 00007fff`05a3498b chrome!blink::EventTarget::addEventListener(
class WTF::AtomicString * event_type = 0x00000027`cbdfd648
touchstart,
class blink::V8EventListener * listener = <Value unavailable error>,
class blink::AddEventListenerOptionsOrBoolean * options_union = <Value unavailable error>)+0x101 [c:\b\s\w\ir\cache\builder\src\third_party\blink\renderer\core\dom\events\event_target.cc @ 455]
05 00000027`cbdfd620 00007fff`055b86e6 chrome!blink::`anonymous namespace'::AddEventListenerOperationCallback(
class v8::FunctionCallbackInfo<v8::Value> * info = 0x00000027`cbdfd870)+0x30b [c:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\blink\renderer\bindings\core\v8\v8_event_target.cc @ 154]
06 00000027`cbdfd7c0 00007fff`055b819e chrome!v8::internal::FunctionCallbackArguments::Call(
class v8::internal::CallHandlerInfo handler = <Value unavailable error>)+0x126 [c:\b\s\w\ir\cache\builder\src\v8\src\api\api-arguments-inl.h @ 159]
07 00000027`cbdfd8f0 00007fff`055b7ede chrome!v8::internal::`anonymous namespace'::HandleApiCallHelper<0>(
class v8::internal::Isolate * isolate = 0x0000423d`00000000,
class v8::internal::Handle<v8::internal::HeapObject> function = <Value unavailable error>,
class v8::internal::Handle<v8::internal::HeapObject> new_target = class v8::internal::Handle<v8::internal::HeapObject>,
class v8::internal::Handle<v8::internal::FunctionTemplateInfo> fun_data = class v8::internal::Handle<v8::internal::FunctionTemplateInfo>,
class v8::internal::Handle<v8::internal::Object> receiver = class v8::internal::Handle<v8::internal::Object>,
class v8::internal::BuiltinArguments * args = 0x00000027`cbdfda30)+0x1ee [c:\b\s\w\ir\cache\builder\src\v8\src\builtins\builtins-api.cc @ 115]
08 00000027`cbdfd9f0 00007fff`055b7d97 chrome!v8::internal::Builtin_Impl_HandleApiCall(
class v8::internal::BuiltinArguments * args = 0x00000000`00000008,
class v8::internal::Isolate * isolate = 0x0000423d`00000000)+0xfe [c:\b\s\w\ir\cache\builder\src\v8\src\builtins\builtins-api.cc @ 143]
09 00000027`cbdfdab0 00007fff`05f6a87c chrome!v8::internal::Builtin_HandleApiCall(
int args_length = 0n8,
unsigned int64 * args_object = 0x00000027`cbdfdb98,
class v8::internal::Isolate * isolate = 0x0000423d`00000000)+0x47 [c:\b\s\w\ir\cache\builder\src\v8\src\builtins\builtins-api.cc @ 131]
...and the resolved options for the event listener are:
0:000> dx -r1 ((chrome!blink::AddEventListenerOptionsResolved *)0x3ba382d30558)
((chrome!blink::AddEventListenerOptionsResolved *)0x3ba382d30558) : 0x3ba382d30558 [Type: blink::AddEventListenerOptionsResolved *]
[+0x008] has_capture_ : true [Type: bool]
[+0x009] capture_ : false [Type: bool]
[+0x010] has_once_ : true [Type: bool]
[+0x011] has_passive_ : true [Type: bool]
[+0x012] once_ : false [Type: bool]
[+0x013] passive_ : false [Type: bool]
[+0x018] signal_ [Type: blink::Member<blink::AbortSignal>]
[+0x020] passive_forced_for_document_target_ : false [Type: bool]
[+0x021] passive_specified_ : false [Type: bool]
rc...@google.com <rc...@google.com> #16
Thank you for waiting.
We have logged this issue internally to investigate further. Please note that we cannot give you any timelines, but you can star the issue to get notifications.
jh...@google.com <jh...@google.com>
co...@gmail.com <co...@gmail.com> #17
to...@gmail.com <to...@gmail.com> #18
really ? not reproducible ? . . . I did not had to search a lot to find this here
https://maps.googleapis.com/maps/api/js
c.ontouchstart = c.ontouchmove = c.ontouchend = c.ontouchcancel = function(d) {
_.Gf(d);
_.Hf(d)
} ;
This is a result from
lu...@scantek.com.au <lu...@scantek.com.au> #19
This definitely is still happening, can be checked in the documentation for embedded maps as well (scroll down to the section where a map is shown on-screen, upon loading and with devtools open the violation warnings will appear):
The line that seems to trigger this is obfuscated, but seems marked as line 75 in utils.js:
return function(c) {
var d = a
, e = b
, f = !1;
"mouseenter" == d ? d = "mouseover" : "mouseleave" == d ? d = "mouseout" : "pointerenter" == d ? d = "pointerover" : "pointerleave" == d && (d = "pointerout");
if (c.addEventListener) {
if ("focus" == d || "blur" == d || "error" == d || "load" == d || "toggle" == d)
f = !0;
c.addEventListener(d, e, f)
} else
c.attachEvent && ("focus" == d ? d = "focusin" : "blur" == d && (d = "focusout"),
e = Soa(c, e),
c.attachEvent("on" + d, e));
return {
eventType: d,
ne: e,
capture: f
}
}
}```
With the specific highlighted line being: `c.addEventListener(d, e, f)`
le...@gmail.com <le...@gmail.com> #20
Could simply adding:
c.addEventListener(d, e, f, {passive: true})
Fix this problem for everyone?
pa...@gmail.com <pa...@gmail.com> #21
We are also getting 21 violations for non-passive event listeners in init.embed.js (chrome dev tools - touchstart, touchmove and mousewheel) after embedding google maps.
(
Is there still no solution for this?
Thanks in advance
19...@gmail.com <19...@gmail.com> #22
<iframe title="ci trovi qui" width="400" height="400" load="lazy" frameborder="0" src="
allowfullscreen></iframe>
</div>--> " al posto delle xxxxxxxxxxxxxxxxxxxxx c'è la mia key. mettendo <!-- <div>....</div>--> la console del browser non segnala più nessun avviso, ma ovviamente non si vede più la mappa.... come risolvo?
jo...@xmeasures.com <jo...@xmeasures.com> #23
This is 100% happening and reproducable for me with Google Maps API v3 usage, outside of any frameworks whatsoever, in vanilla JS, when loaded via the preferred way:
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
key: "YOUR_API_KEY",
v: "weekly",
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
// Add other bootstrap parameters as needed, using camel case.
});
</script>
Then rendering directions via the DirectionsRenderer after importing the 'routes' library:
const { DirectionsService, DirectionsRenderer } = await google.maps.importLibrary('routes');
const directionsService = new DirectionsService();
const directionsDisplay = new DirectionsRenderer();
const directionsOptions = {
map: mapDrawing, // the Google Map reference, set elsewhere via: new Map(el, options);
panel: document.getElementById('directionsPanel'), // where should the driving directions display?
markerOptions: marker // basic Marker, set elsewhere
};
const request = {
origin: startGeolocation, // set elsewhere
destination: endGeolocation, // set elsewhere
travelMode: google.maps.DirectionsTravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.METRIC
};
directionsDisplay.setOptions(directionsOptions);
directionsService.route(request, function (resp, status) {
if (status === 'OK') {
directionsDisplay.setDirections(resp);
} else {
console.warn('DID NOT work! notok');
}
});
I would love to code up a JS fiddle, but need an API Key to do so (and I'm not exposing mine!). I am baffled by the lack of acknowledgment of the issue, and insulted by the status "Won't fix (Not reproducible)" when CLEARLY it is being reproduced by so many people in 2023 alone.
co...@spencerplanton.com <co...@spencerplanton.com> #24
The google API needs to use passive listeners as per "c.addEventListener(d, e, f, {passive: true})" above.
Utterly crazy not to address passive listener issues which are causing warnings all over user applications.
jh...@google.com <jh...@google.com>
ka...@google.com <ka...@google.com>
ra...@gmail.com <ra...@gmail.com> #25
I'm experiencing this as well. Just opened a ticket, that I see now is a duplicate of this.
sa...@lau.do <sa...@lau.do> #26
ka...@google.com <ka...@google.com> #27
We greatly appreciate your patience.
We believe that all the passive event warning in Maps JS should be now fixed. Please let us know if the issue is still recurring on your end.
For Maps Embed API, the fix will be included 3.59 release. That being said, we will now be closing this issue.
Thanks for working with us!
Description
Describe your issue
Many places in the Google Maps Javascript API client libraries apparently use non-passive event listeners, and this generates warnings in the developer console like this:
Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
This can be quite annoying, and in some cases can generate a quite large number of warnings. Apparently, this has been noticed by many other developers, as seen in this stack overflow question with 29 upvotes: Javascript Google Maps API & non-passive event handlers .
As this occurs in Google code, I cannot fix it. In my React based application, this can generate hundreds of console messages, and lock up the application while the developer console logs these messages. It occurs in many places in Google code, and as said code is heavily obfuscated, I'm not able to give you good advice on where the problem is, other than a few snippets, like this function in util.js, which the console message points me to:
> google.maps.version
3.44.7
What steps will reproduce the problem? Please also provide a code sample which demonstrates your issue (e.g. via jsfiddle.net, or jsbin.com)
I have searched known issues, and did not see anything similar.