Prompt
How do I debug address autocomplete not showing results?
Latest observation
Here’s a practical checklist to debug why address autocomplete isn’t showing results.
1) Verify the API is actually being called
Open your browser’s DevTools → Network tab and type in the address field.
Check:
- Is a request being sent when you type?
- Does it return 200 OK?
- Is the response empty, erroring, or delayed?
If no request is sent:
- The input event may not be wired up
- Debounce/throttle may be too aggressive
- The component may be disabled or not mounted
2) Inspect the response payload
If the request is sent but no suggestions show:
- Confirm the API returns suggestions in the expected format
- Make sure you’re reading the correct response field
- Log the response to the console
Example issues:
- API returns
results, but your code expectspredictions - Suggestions are nested deeper than expected
- Response is valid, but filtered out by your UI logic
3) Check API key / auth / quota
Autocomplete services often fail silently or return empty results if:
- API key is invalid
- Billing is not enabled
- Required APIs are not enabled
- Quota is exceeded
- Referrer/domain restrictions block your app
Look for:
401 Unauthorized403 Forbidden- messages like
REQUEST_DENIED,OVER_QUERY_LIMIT, orINVALID_REQUEST
4) Confirm query input is valid
Autocomplete often won’t return anything if:
- Input is too short
- You’re sending whitespace only
- You’re restricting countries/regions too much
- You’re passing a malformed query string
Try with a simple query like:
"1 Main""San""1600 Amphitheatre"
5) Check for frontend rendering issues
The results may exist, but not be visible because of UI problems:
- Dropdown hidden by CSS
- Z-index issue
- Parent container overflow clipping
- Positioning bug
- Suggestions render offscreen
- Text color matches background
Try temporarily rendering the suggestions as plain text below the input.
6) Confirm event handling and state updates
In React/Vue/Angular/etc., autocomplete can fail if:
- State updates are not applied
- Old responses overwrite new ones
- Input value isn’t bound correctly
- Component rerenders clear the suggestion list
Common bug:
- Typing triggers request A and then B
- A returns after B and clears the results
Fix with:
- request cancellation
- sequence IDs
- checking latest query before setting state
7) Check debounce timing
If using debounce:
- The delay may be too long
- The function may never fire
- The debounced function may be recreated on every render
Try removing debounce temporarily to see if results appear.
8) Look at console errors
DevTools → Console:
- JS exceptions can stop the autocomplete logic
- Missing environment variables can break API calls
- CORS errors may prevent requests from completing
9) Test the API outside your app
Use:
- Postman
- cURL
- Browser URL directly, if supported
This helps determine whether the issue is:
- API/service-side
- frontend integration
- UI rendering
10) Add debug logging
Log these values:
- input text
- request URL/body
- response status
- response payload
- number of suggestions after parsing/filtering
Example:
console.log("Query:", query);
console.log("Response:", response);
console.log("Suggestions:", suggestions);
11) Common integration-specific issues
Google Places Autocomplete
- API not enabled
- billing disabled
- missing
libraries=places - wrong script loading order
- restrictions blocking requests
Mapbox / Pelias / custom API
- wrong endpoint
- incorrect token
- response shape mismatch
- country filter too strict
Native mobile autocomplete
- permissions/network issues
- async state not updating
- outdated SDK
Quick isolation test
To narrow it down fast:
- Hardcode a known-good query
- Remove all filters/restrictions
- Remove debounce
- Render raw results directly
- Confirm the API response in Network tab
If that works, reintroduce features one by one until it breaks.
If you want, I can help you debug a specific implementation — paste your code, framework, and which autocomplete provider you’re using.