Algolia Places: 'container' must point to an <input> element
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behavior? I have the following error message in my console: Uncaught Error: Algolia Places: ‘container’ must point to an element.
However in my JS I properly select the right id as follow: `` `const places = require(‘places.js’);
const placesAutocomplete = places({ appId: ‘xx’, apiKey: ‘xx’, container: document.getElementById(‘loc’) });
const initPlaces = places(placesAutocomplete); `
As you can see on the following screenshot, #loc is an input:
Can you please help? Thank you
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Algolia Places error 'container' must point to an <input> element
Just the following is fine. Run the snippet. <script type="text/javascript"> var placesAutocomplete = places({ container: document.
Read more >Error: Algolia Places: 'container' must point to an <input> element ...
Error: Algolia Places: 'container' must point to an <input> element ... After install the module, I've created an address field and added the...
Read more >Cant get Places.js Map to render upon Page load always ...
I am trying to dynamically generate a map based on a predefined locations in my worpdress page ids or queries, for example here ......
Read more >places.js - npm
To use Algolia Places, all you need is an <input> and some JavaScript code that will load and use the places.js library.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Pifoupif closing this issue for now. Feel free to reopen it with a reproducible code sample, thanks 👍
If you’re still struggling, try replace: document.getElementById(‘loc’) with document.querySelector(‘#loc’)
Hopefully that helps