New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate User example not working when used in CRA #921
Comments
This error seems to be inside mapbox-gl. Can you check which mapbox-gl version is installed in your project? |
These are installed components
I wonder why copying 100% of the code from your example to separate file and creating the Storybook story fails. |
Yeah I'm having the same issue. Have the same mapbox-gl version. |
Downgrading to mapbox-gl@1.4.1 seemed to fix the issue. |
well, it would, but I am using this lib and their examples. Maybe there is nothing to do with the mapbox itself rather than passing the correct data from wrapped component to actual mapbox component. |
I personally still have the error after downgrading to 1.4.1 |
for me, it's gone. |
Same issue here - is downgrading the only way to solve it? |
@xintongxia I tried this on the standalone example and it also errors out. You can reproduce this by upgrading the mapbox-gl dependency to 1.5.0. I believe it can be fixed by assigning |
Should be fixed in 5.1.2. |
5.1.2 is published |
@xintongxia After upgrading from react-map-gl 5.1.0 to 5.1.2 and trying to nest the within my component, I receive the following error:
This error (when in debug mode on localhost) causes the debugger to pause execution. If I unpause to continue past this error, the map jumps to the user-location (it doesn't fly) and then the map becomes unresponsive. I am also using create-react-app. Edit: I found this stack overflow thread from 2016 which implies that a div may be missing around the internal mapbox instance? |
@krewllobster what is your mapboxgl version? maybe you can try 1.5? I put our example code in a sandbox, which you can playaround. It would be easier for me to debug if you can share the code which can reproduce the error. |
@xintongxia already on The code causing the issue:
I did get it to work within your codesandbox, but its still causing issues in my repo. |
Also, upon further investigation, the map is not unresponsive after resuming from the error. It was tricking me! I have maxZoom: 15 in mapOptions, rather than using the maxZoom prop. FYI, if you add mapOptions={{maxZoom: 15}} and keep zooming after the map stops (using macbook trackpad), the map continue "zooming in" even as the viewport doesn't change. In order to zoom back out, you have to un-scroll as much as you over-scrolled. The zooming is totally fixed by just using the maxZoom prop though, so probably not a real issue. Geolocate still breaks though. |
And sorry, one more thing (I'm not sure about Github issue etiquette as to whether I should be leaving new comments or editing): The line in mapbox.gl.js that is causing the error is: If I set showUserLocation={false} then the error goes away. |
@krewllobster Which browser are you using? |
Google Chrome |
I'll look into it shortly. |
fixed in 5.1.3. |
when i try to add the same code to a component and then call it within my react app i keep getting the following error,
Map settings are the same as in the example.
In general all other (that i am using) features are working.
Any help would be appreciated
The text was updated successfully, but these errors were encountered: