Uncaught TypeError: Cannot read properties of undefined (reading 'emit')
Uncaught TypeError: Cannot read properties of undefined (reading 'emit') at r._onMapMouseMove (google_map.js:970:1) at HTMLUnknownElement.callCallback (react-dom.development.js:4161:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:4210:1) at invokeGuardedCallback (react-dom.development.js:4274:1) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4288:1) at executeDispatch (react-dom.development.js:9038:1) at processDispatchQueueItemsInOrder (react-dom.development.js:9070:1) at processDispatchQueue (react-dom.development.js:9083:1) at dispatchEventsForPlugins (react-dom.development.js:9094:1) at react-dom.development.js:9285:1
Environment:
- OS: [windows]
- Browser [chrome]
- Version [e.g. 22]
I had the same issue, try removing <React.StrictMode></React.StrictMode> from your index.js file
Do you know how to fix it without removing strict mode?
For me this only shows up for me when I run with nextjs in development mode and only started showing up when I upgraded to react 18. A down grade to react 17 or removal of strict mode from next.config.js and index.js fixed the issue for me
@Mateusz-Podemski-Forte-Digital did you figure it out ? I have the same problem and i'm looking for a way to fix it without disabling strict mode
Unfortunately no, for local development I had to disable strict mode :/
I fixed this issue by using the old ReactDOM.render(...) instead of ReactDOM.createRoot(...).render(...)