Tested versions (local / reproduce)
three version: 0.166.0 / 0.165.0
@react-three/fiber version: 8.15.12 / 8.16.8
react-three-map version: 1.0.0-next.0 / 1.0.0-next.0
node version: 18.18.2 / 22.14.0
npm (or yarn) version: 9.2.0 / 11.1.0
Problem description:
I got a Cannot read properties of undefined (reading 'getMap') in Canvas.tsx line 22 after updated to 1.0.0
const map = useMap().current!.getMap(); // eslint-disable-line @typescript-eslint/no-non-null-assertion
upon loading a canvas.
Relevant code:
https://codesandbox.io/p/devbox/react-three-map-gettings-started-forked-l4sjk7
I've updated the dependencies, but nothing significant changed.
Suggested solution:
The error occurs even when a valid access token isn't provided, so perhaps it needs to wait until the map is fully loaded—at least until useMap() becomes available—or a check should be added for when useMap() returns null.
Tested versions (local / reproduce)
threeversion: 0.166.0 / 0.165.0@react-three/fiberversion: 8.15.12 / 8.16.8react-three-mapversion: 1.0.0-next.0 / 1.0.0-next.0nodeversion: 18.18.2 / 22.14.0npm(oryarn) version: 9.2.0 / 11.1.0Problem description:
I got a Cannot read properties of undefined (reading 'getMap') in Canvas.tsx line 22 after updated to 1.0.0
upon loading a canvas.
Relevant code:
https://codesandbox.io/p/devbox/react-three-map-gettings-started-forked-l4sjk7
I've updated the dependencies, but nothing significant changed.
Suggested solution:
The error occurs even when a valid access token isn't provided, so perhaps it needs to wait until the map is fully loaded—at least until useMap() becomes available—or a check should be added for when useMap() returns null.