question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Algolia Places: 'container' must point to an <input> element

See original GitHub issue

Do 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:

Capture d’écran 2019-05-03 à 11 49 42

Can you please help? Thank you

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
raphicommented, Sep 16, 2019

@Pifoupif closing this issue for now. Feel free to reopen it with a reproducible code sample, thanks 👍

1reaction
AlexanderHildrethcommented, May 22, 2019

If you’re still struggling, try replace: document.getElementById(‘loc’) with document.querySelector(‘#loc’)

Hopefully that helps

Read more comments on GitHub >

github_iconTop 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 >
Algolia Places: 'container' must point to an <input> element ...
I have this input:
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found