I think you are missing steps .
1. Go to Google Developers Console.
2. Enable Google Maps Javascript API.
3. Then Generate API key .
4. Then put that API key in the bottom of your code in this section.
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_JAVASCRIPT_API_KEY&libraries=places&callback=initService"
async defer></script>
This will 100% work, if follow the steps carefully.
1
solved Google places API key error