geocoder
geocoder copied to clipboard
address_components_of_type nil when setting Google Maps API key restrictions
Expected behavior
Expecting success when using address_components_of_type while having a key restriction (either domain restriction or API restriction) on my Google Maps API key.
Actual behavior
Works fine when I do not set any restrictions on the Google Maps key.
If I restrict it to example.com/* and *.example.com/* then I get this error: undefined method address_components_of_type' for nil:NilClass`
If I remove the domain restrictions and instead restrict it by API type (and enable only the Places API, Geocoding API, and Javascript API), I get the same error.
I cannot tell if this is a google maps issue or a geocoder issue. But my assumption is that address_components_of_type is using a resource that is outside of those key restrictions.
Environment info
- Geocoder version: 1.8.0
- Rails version: 6.1.7.1
- Database (if applicable):
- Lookup (if applicable): Google