TypeError: Cannot read properties of undefined (reading 'dispose')
See original GitHub issueAfter upgrading to react@18 my google maps crashing on render.
Component code:
import GoogleMapReact from "google-map-react";
import markerSvg from "../../assets/images/google_maps_mark.svg";
const { REACT_APP_PUBLIC_GOOGLE_MAPS_API_KEY } = process.env;
const Map = ({ lat, lng})=> {
return (
<div style={{ height: "400px", width: "400px" }}>
<GoogleMapReact
bootstrapURLKeys={{ key: REACT_APP_PUBLIC_GOOGLE_MAPS_API_KEY}}
defaultCenter={{ lat, lng }}
defaultZoom={11}
>
<img
src={markerSvg}
lat={lat}
lng={lng}
text="My Marker"
alt="marker"
/>
</GoogleMapReact>
</div>
);
}
export default Map;
Errors screenshots https://ibb.co/bsGV76c https://ibb.co/ZGBhV8B https://ibb.co/X5vNTt5
OS: [mac] Browser [any browser]
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:5
Top Results From Across the Web
TypeError: Cannot read property 'dispose' of undefined #6
Okay. The issue was revealed. The problem is: you are interacting with the editor before its initialization. Let me explain what happens in...
Read more >[OutSystems Maps] Cannot read properties of undefined ...
TypeError : Cannot read properties of undefined (reading 'dispose'). at Map.dispose (https://mysite.com/Job/scripts/OutSystemsMaps.
Read more >cannot read properties of undefined (reading 'dispose') google ...
The TypeError: Cannot read properties of undefined (reading 'map') occurs when we call the `map()` method on an `undefined` value, most often when...
Read more >cannot read property 'dispose' of null angular 4 - Stack Overflow
First of all, the type is not defined in component. Define it in the component. Like this characters:any : Array<any> = [];. Then...
Read more >The "Uncaught TypeError: Cannot read property 'dispose' of ...
dxChart - The "Uncaught TypeError: Cannot read property 'dispose' of null" error is thrown after the "W2106 - Labels of 'horizontal' axis ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try removing <React.StrictMode></React.StrictMode> from your index.js file
Any updates?!? I am also having the same issue…