-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
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.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-assertionupon 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.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed