Skip to content
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

Can't import fitBounds from google-map-react #903

Closed
Venskiy opened this issue Aug 4, 2020 · 15 comments · Fixed by #932
Closed

Can't import fitBounds from google-map-react #903

Venskiy opened this issue Aug 4, 2020 · 15 comments · Fixed by #932

Comments

@Venskiy
Copy link

Venskiy commented Aug 4, 2020

I'm trying to update library to the newest release(2.0.4), but I can't import fitBounds. When I import fitBounds like this: import { fitBounds } from 'google-map-react';, webpack will show me this warning: "export 'fitBounds' was not found in 'google-map-react'

@itsmichaeldiego
Copy link
Member

itsmichaeldiego commented Aug 4, 2020

@Venskiy That is odd, I tried myself and it was working, would you please hold on the update till I can check that?

Thanks for reporting it btw!

@Venskiy
Copy link
Author

Venskiy commented Aug 4, 2020

Thank you for helping.
I will also try to reproduce it on a clean project.

@itsmichaeldiego
Copy link
Member

@Venskiy Yeah if you could share a live example with https://codesandbox.io/ or similar would be awesome, to see how are you using fitBounds and be able to test it properly

@Venskiy
Copy link
Author

Venskiy commented Aug 5, 2020

@itsmichaeldiego
Here is sandbox example https://codesandbox.io/s/fast-glade-9kouq
I am able to import GoogleMap, but I can't import fitBounds. It's undefined.

@itsmichaeldiego
Copy link
Member

@Venskiy Awesome, thanks, I will take a look as soon as I can

@fracmak
Copy link

fracmak commented Aug 6, 2020

Would this be part of the problem?

1cae88e#diff-1fdf421c05c1140f6d71444ea2b27638

@karldanninger
Copy link
Member

@fracmak that would be my guess as well! I'll try to PR a fix later today.

@itsmichaeldiego
Copy link
Member

itsmichaeldiego commented Aug 6, 2020

@fracmak Yes, indeed that is the problem, exporting the lib files that way resulted in an error with SSR. I rolled it back and checked and it seemed the others libs were being exported too, but the issue was that the build was outdated.

The issue is #901

@adamklepacz
Copy link

./utils/helpers/mapHelpers.js
Attempted import error: 'fitBounds' is not exported from 'google-map-react'.

could you guys publish a fix to it? And finally make it work. Every version from 2.0.0 broke my app so I needed to downgrade to the last stable release which was 1.1.7

@itsmichaeldiego
Copy link
Member

@adamklepacz You are free to create your own PR, I'll approve it and merge it and release a new version 👍

@itsmichaeldiego
Copy link
Member

I will take a look at this as soon as I've some spare time, stay tuned!

@michal-novacek
Copy link

first the typescript definition of fitBounds was broken in @types for 1.1.7, now it can't be imported in 2.x

i am trying to use this thing in production, please be more conservative in your testing and release strategy

@itsmichaeldiego
Copy link
Member

itsmichaeldiego commented Aug 31, 2020

@michal-novacek I think instead of complaining you should follow other people examples and try to help out, that is what open-source is about.

Besides that, if you want to use a library (any library) in production be careful on how you use your packages, as 2.x is a major release, that means that has breaking changes, you should never update to major packages when in production unless testing them before, so please be more conservative in your testing and release strategy ;)

Going back to the issue, we're working together with @NerdCowboy and @karldanninger to fix it, feel free to check #923 and the conversation there, so you can learn more about what's going on, you'll see that its not our problem but an issue with microbundle, that we're trying to fix together as a team 👍

@itsmichaeldiego
Copy link
Member

itsmichaeldiego commented Sep 1, 2020

This was fixed and released in 2.1.3, please let me know if it works!! 🙏

Sorry for the delay!

@rekomat
Copy link

rekomat commented Sep 1, 2020

It does! Thanks for the patch! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants