[Bug] Event listener on map initialized by defaultBounds causes warning in console
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
Research direction
Start by reproducing the provided Map example, then inspect use-map-events.ts around createMapEvent and use-map-instance.ts around the fitBounds call shown in the stack trace. Done means initializing defaultBounds with onCenterChanged no longer produces the console warning; verify the reproduction after the change.
Written by the indexing model from the issue text.
Description
Description
Warning in console when initializing a map with defaultBounds and adding an event listener:
main.js:169 [createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new
Steps to Reproduce
import React from 'react';
import {
APIProvider,
Map,
} from '@vis.gl/react-google-maps';
import './App.css';
const API_KEY = '';
const MAP_ID = '';
export default function MyApp() {
return (
<APIProvider apiKey={API_KEY}>
<Map
id="map"
mapId={MAP_ID}
defaultBounds={{north: 45, south: 0, east: 0, west: 45}}
onCenterChanged={() => {console.log('center changed')}}
/>
</APIProvider>
);
}
Environment
- Library version: 1.2.0
- Google maps version: weekly
- Browser and Version: Chrome 129.0.6668.70
- OS: Mint 22
Logs
main.js:169 [createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new
createMapEvent @ use-map-events.ts:104
(anonymous) @ use-map-events.ts:66
_.nk @ main.js:169
tk @ main.js:170
_.rk.set @ main.js:294
(anonymous) @ main.js:177
d @ map.js:23
iC @ map.js:24
(anonymous) @ main.js:414
Promise.then
fn.fitBounds @ main.js:414
(anonymous) @ use-map-instance.ts:157
commitHookEffectListMount @ react-dom.development.js:23189
commitPassiveMountOnFiber @ react-dom.development.js:24965
commitPassiveMountEffects_complete @ react-dom.development.js:24930
commitPassiveMountEffects_begin @ react-dom.development.js:24917
commitPassiveMountEffects @ react-dom.development.js:24905
flushPassiveEffectsImpl @ react-dom.development.js:27078
flushPassiveEffects @ react-dom.development.js:27023
(anonymous) @ react-dom.development.js:26808
workLoop @ scheduler.development.js:266
flushWork @ scheduler.development.js:239
performWorkUntilDeadline @ scheduler.development.js:533
Show less
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 195
- Avg merge
- 6h 26m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from visgl/react-google-maps
-
Polygon / Polyline: edits after a controlled `paths` update never reach `onPathsChanged`Possibly taken @anubhavlal07 claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
visgl/react-google-maps#1120 ·
Maintainers usually reply within 1 day
-
google maps issue
Difficulty 3/5 1-2 days Newbie friendliness 74/100
visgl/react-google-maps#1080 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs more info
Difficulty 3/5 1-2 days Newbie friendliness 45/100
visgl/react-google-maps#1039 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
visgl/react-google-maps#918 · 9 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
visgl/react-google-maps#905 ·
Maintainers usually reply within 1 day
All issues in visgl/react-google-maps
Similar issues
-
accessibility area:ci ci-test level:low priority:high type:test
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
skytuhua-org/Gen-V1#3132 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
drmrd/vernacular#1238 ·
Maintainers usually reply within 1 day
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement migration-prioritized
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Hudson-Pufferfish/local-party-console#136 ·
Maintainers usually reply within 1 day
-
priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day