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

Fix 'bounds are not valid' console error #531

Merged
merged 1 commit into from
May 25, 2022

Conversation

rachelekm
Copy link
Contributor

@rachelekm rachelekm commented May 24, 2022

Overview

This PR fixes the 'bounds are not valid' console error that was appearing on main page start. We set the map bounds using the neighborhoodBoundsExtent prop, which starts off as null before data.neighborhoodBounds gets loaded with data and can update the neighborhoodBoundsExtent selector. It looks like the map component renders while the neighborhoodBoundsExtent prop is still null and then re-renders once data loads/prop updates—why the map/functionality still worked. We weren't getting this error before, so I'm wondering if the bundler switch (PR #457) affected the timing in which the neighborhood bounds asset loads on app start and the map component render just happens to catch it a little too early now? Either way, I just added a conditional to render if neighborhoodBoundsExtent isn't null and that seemed to do the trick.

Checklist

  • Run ./scripts/format to lint, format, and fix the application source code.

Testing Instructions

  • scripts/server
  • Login as either an anonymous or verified user
  • Confirm map and neighborhood bounds display correctly without any bounds console errors
  • Select a neighborhood and confirm map bounds update without error
  • Select "back to recommendations" and confirm map bounds update back without error

Resolves #520

@aaronxsu aaronxsu self-requested a review May 24, 2022 22:19
@aaronxsu aaronxsu self-assigned this May 24, 2022
Copy link
Member

@aaronxsu aaronxsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 the error message won't show anymore as tested by following the instructions after the code change. Good to go 🚀

@rachelekm rachelekm merged commit c8d8768 into develop May 25, 2022
@rachelekm rachelekm deleted the fix/rkm/fix-bounds-on-map-load branch May 25, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix 'bounds are not valid' console error on map load
2 participants