[Bug]: TypeError: Cannot read properties of undefined (reading 'getRootNode')
Description
Our app (https://restaurants.umai.io/en/restaurants) crashes randomly with this report, and i found the stack trace as below:
Please find more details for traces here: https://umai.sentry.io/share/issue/75cbb8ab61614381b63877782fadd42e/
Steps to Reproduce
The error may stem from the @vis.gl/react-google-maps library attempting to access a map instance that has already been unmounted or is in an invalid state during the cleanup phase.
Environment
- Library version: "@vis.gl/react-google-maps": "^1.5.4",
- Google maps version: weekly
- Browser and Version: Chrome 137.0.0
- OS: Windows >=10
Logs
Exception - This event:
TypeError: Cannot read properties of undefined (reading 'getRootNode')
{
arguments: [
{
message: Cannot read properties of undefined (reading 'getRootNode'),
name: TypeError,
stack:
TypeError: Cannot read properties of undefined (reading 'getRootNode')
at Object.sn (https://maps.googleapis.com/maps-api-v3/api/js/61/10d/main.js:173:41)
at set map (https://maps.googleapis.com/maps-api-v3/api/js/61/10d/marker.js:105:349)
at https://restaurants.umai.io/_next/static/chunks/4465-9b4e1d888e5ea8c0.js:1:16560
at oK (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:87697)
at ux (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:106467)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105730)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105928)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105862)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105862)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105928)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105862)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105862)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105792)
at uS (https://restaurants.umai.io/_next/static/chunks/118e8794-c82d6148a62986e3.js:1:105928)
at uw (https://restaurants.umai.io/_next/static/chunks/118e8794-...
}
]
}
Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError
https://developers.google.com/maps/documentation/javascript/error-messages#not-loading-api-from-google-maps-error
{
arguments: [
Google Maps JavaScript API error: NotLoadingAPIFromGoogleMapsError
https://developers.google.com/maps/documentation/javascript/error-messages#not-loading-api-from-google-maps-error
],
logger: console
}
Can you verify if those problems also occur when you remove the googlemaps part from your service-worker configuration?
NotLoadingAPIFromGoogleMapsError sounds like that might be an issue.
@usefulthink thanks for responding... I will surely check this out.
Thanks for pointing this out for further debugging.
@m-nathani We have the same issue... Could you come up with a solution?
@m-nathani We have the same issue... Could you come up with a solution?
@MarcTheAngel hey, I removed the caching of maps script in web worker, as I thought it's wasn't a necessary to cache.
Although I didn't faced it again yet, but I am not 100% sure it was cause.
same here
TypeError: Cannot read properties of undefined (reading 'getRootNode')
at _.bo (/maps-api-v3/api/js/62/8d/intl/no_ALL/main.js:189:41)
at set map (/maps-api-v3/api/js/62/8d/intl/no_ALL/marker.js:105:120)
at c (../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs:1134:17)
at Mj (../node…